rabbitmq

24
Friday, May 8, 15

Upload: sarunyhot-suwannachoti

Post on 03-Aug-2015

31 views

Category:

Technology


1 download

TRANSCRIPT

Page 1: RabbitMQ

Friday, May 8, 15

Page 2: RabbitMQ

RabbitMQ: Who, What?

• Developed by SpringSource

• Written in Erlang

• Message Broker (MOM)

• Advanced Message Queuing Protocol (AMQP)

Friday, May 8, 15

Page 3: RabbitMQ

Who uses AMQP?

• Financial Services

• Bank of America

• JPMorgan Chase Bank

• Microsoft

• Red Hat

• US Department of Homeland Security

Friday, May 8, 15

Page 4: RabbitMQ

RabbitMQ: Why?

• Distributed

• Parallel

• Multiple worker balancing

• Acknowledgement

• Concurrent limit

• Ready task queue

Friday, May 8, 15

Page 5: RabbitMQ

Mailbox, Postman & Post office

Friday, May 8, 15

Page 6: RabbitMQ

Mailbox, Postman & Post office

Friday, May 8, 15

Page 7: RabbitMQ

RabbitMQ: How?

• Producing

• Queue

• Consuming

Friday, May 8, 15

Page 8: RabbitMQ

RabbitMQ: How?

P

Producingmeans nothing more than sending. A program that sends messages is a producer.

Friday, May 8, 15

Page 9: RabbitMQ

RabbitMQ: How?

Queue

• A queue is the name for a mailbox.

• it can store as many messages as you like.

• Many producers can send messages that go to one queue, many consumers can try to receive data from one queue.

queue_name

Friday, May 8, 15

Page 10: RabbitMQ

RabbitMQ: How?

Consuming

• has a similar meaning to receiving.

• A consumer is a program that mostly waits to receive messages.

C

Friday, May 8, 15

Page 11: RabbitMQ

Hello World

P C

Hello

Friday, May 8, 15

Page 12: RabbitMQ

Sending

P

Hello

Friday, May 8, 15

Page 13: RabbitMQ

Receiving

C

Hello

Friday, May 8, 15

Page 14: RabbitMQ

Work Queues

P

C1

C2

Friday, May 8, 15

Page 15: RabbitMQ

Demo

Friday, May 8, 15

Page 16: RabbitMQ

Exchanges

XP

• the producer never sends any messages directly to a queue.

• the producer doesn't even know if a message will be delivered to any queue at all.

• Instead, the producer can only send messages to an exchange.

C1

C2

Friday, May 8, 15

Page 17: RabbitMQ

Exchange Types

• Fanout

• Direct

• Topic

Friday, May 8, 15

Page 18: RabbitMQ

Fanout Exchange

Friday, May 8, 15

Page 19: RabbitMQ

Direct Exchange

Friday, May 8, 15

Page 20: RabbitMQ

Topic Exchange

Friday, May 8, 15

Page 21: RabbitMQ

Demo

Friday, May 8, 15

Page 22: RabbitMQ

Adaption

P

C1

X

type=topicimage.resize

image.notify

image.publish.*

C1

image.publish.thumbnailC1

C1

Friday, May 8, 15

Page 23: RabbitMQ

Adaption

P

C1

X

type=topicblackman.interday

blackman.stock.import

blackman.stock.sync-rebirth

C1

blackman.stock.*C1

C1

Friday, May 8, 15

Page 24: RabbitMQ

Kue VS RabbitMQKue RabbitMQ

Concurrency

Failure Attempts

Failure Backoff

Job Logs

Job Progress

Priority

Expiration

Work load

JSON API

Cluster

User-Interface

Delayed Jobs

Friday, May 8, 15