13
RABBITMQ MESSAGING IN THE CLOUD Thanh Tran

rabbitmq messaging in the cloud

Embed Size (px)

DESCRIPTION

introduction Why messaging important? Why rabbitmq? What Rabbitmq can do? What need to be remembered in rabbitmq?

Citation preview

Page 1: rabbitmq messaging in the cloud

RABBITMQMESSAGING IN THE CLOUD

Thanh Tran

Page 2: rabbitmq messaging in the cloud

INTRODUCTION Why messaging important? Why rabbitmq? What Rabbitmq can do? What need to be remembered in rabbitmq?

Page 3: rabbitmq messaging in the cloud

WHY MESSAGING IMPORTANT? Scalability issue Traditional synchronous programming models

are poor at large scale Cloud computing Messaging enables scaling by decoupling

components and adding flexibility.

Page 4: rabbitmq messaging in the cloud

WHY RABBITMQ? Free, open source Easily installed and used by clients. Support many client’s languages Asynchronous message passing High performance (up to 30k mps for one

queue, 10k in my desktop), high availability and easy to scale up (cluster)

Support web-based administration

Page 5: rabbitmq messaging in the cloud

WHY RABBITMQ?

Page 6: rabbitmq messaging in the cloud

WHAT RABBITMQ CAN DO?

Producer Consumer

Decoupling

E.g. website passing orders to a credit-card charging engine

Producer Consumer

Bidirectional Decoupling

E.g. remote procedure call

Producer Consumer

Work aggregation, distribution and Decoupling

E.g. website passing orders to a credit-card charging engine

Producer Consumer

Page 7: rabbitmq messaging in the cloud

WHAT NEED TO BE REMEMBERED IN RABBITMQ?

3 key nouns: channel, exchange, queue. 3 types of exchange: direct, fanout, topic

Page 8: rabbitmq messaging in the cloud

3 TYPES OF EXCHANGE IN RABBITMQ

Direct:

X

ExchangeType=direct

rk: routing key bk: Binding key

Ark=“vodka”

“queue_1”

“queue_2”

bk=“vodka

bk=“beer”

Brk=“beer”

Page 9: rabbitmq messaging in the cloud

3 TYPES OF EXCHANGE IN RABBITMQ

Fanout:

X

ExchangeType=fanout

rk: routing key bk: Binding key

Ark=“vodka”

“queue_1”

“queue_2”

Ark=“vodka”

Page 10: rabbitmq messaging in the cloud

3 TYPES OF EXCHANGE IN RABBITMQ Topic: routing keys can be a pattern

* matches any 1 element # matches zero or more elements

X

ExchangeType=direct

rk: routing key bk: Binding key

Ark=“a.b.c”

“queue_1”

“queue_2”

bk=“a.*.c”

bk=“#.e”

Brk=“a.e”

Page 11: rabbitmq messaging in the cloud

DEMO Generate n random integers

Stand alone mode Distributed mode using rabbitmq

How:

master

worker_1queue_1

worker_2

worker_k

queue_2

queue_k

n random integers

n/k

n/k

n/k

Rabbitmq

Mergingqueue

Split j

ob

Page 12: rabbitmq messaging in the cloud

QUESTIONS?

Page 13: rabbitmq messaging in the cloud