rabbitmq
TRANSCRIPT
![Page 1: RabbitMQ](https://reader030.vdocuments.pub/reader030/viewer/2022032503/55beebacbb61eba92f8b45f3/html5/thumbnails/1.jpg)
Friday, May 8, 15
![Page 2: RabbitMQ](https://reader030.vdocuments.pub/reader030/viewer/2022032503/55beebacbb61eba92f8b45f3/html5/thumbnails/2.jpg)
RabbitMQ: Who, What?
• Developed by SpringSource
• Written in Erlang
• Message Broker (MOM)
• Advanced Message Queuing Protocol (AMQP)
Friday, May 8, 15
![Page 3: RabbitMQ](https://reader030.vdocuments.pub/reader030/viewer/2022032503/55beebacbb61eba92f8b45f3/html5/thumbnails/3.jpg)
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](https://reader030.vdocuments.pub/reader030/viewer/2022032503/55beebacbb61eba92f8b45f3/html5/thumbnails/4.jpg)
RabbitMQ: Why?
• Distributed
• Parallel
• Multiple worker balancing
• Acknowledgement
• Concurrent limit
• Ready task queue
Friday, May 8, 15
![Page 5: RabbitMQ](https://reader030.vdocuments.pub/reader030/viewer/2022032503/55beebacbb61eba92f8b45f3/html5/thumbnails/5.jpg)
Mailbox, Postman & Post office
Friday, May 8, 15
![Page 6: RabbitMQ](https://reader030.vdocuments.pub/reader030/viewer/2022032503/55beebacbb61eba92f8b45f3/html5/thumbnails/6.jpg)
Mailbox, Postman & Post office
Friday, May 8, 15
![Page 7: RabbitMQ](https://reader030.vdocuments.pub/reader030/viewer/2022032503/55beebacbb61eba92f8b45f3/html5/thumbnails/7.jpg)
RabbitMQ: How?
• Producing
• Queue
• Consuming
Friday, May 8, 15
![Page 8: RabbitMQ](https://reader030.vdocuments.pub/reader030/viewer/2022032503/55beebacbb61eba92f8b45f3/html5/thumbnails/8.jpg)
RabbitMQ: How?
P
Producingmeans nothing more than sending. A program that sends messages is a producer.
Friday, May 8, 15
![Page 9: RabbitMQ](https://reader030.vdocuments.pub/reader030/viewer/2022032503/55beebacbb61eba92f8b45f3/html5/thumbnails/9.jpg)
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](https://reader030.vdocuments.pub/reader030/viewer/2022032503/55beebacbb61eba92f8b45f3/html5/thumbnails/10.jpg)
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](https://reader030.vdocuments.pub/reader030/viewer/2022032503/55beebacbb61eba92f8b45f3/html5/thumbnails/11.jpg)
Hello World
P C
Hello
Friday, May 8, 15
![Page 12: RabbitMQ](https://reader030.vdocuments.pub/reader030/viewer/2022032503/55beebacbb61eba92f8b45f3/html5/thumbnails/12.jpg)
Sending
P
Hello
Friday, May 8, 15
![Page 13: RabbitMQ](https://reader030.vdocuments.pub/reader030/viewer/2022032503/55beebacbb61eba92f8b45f3/html5/thumbnails/13.jpg)
Receiving
C
Hello
Friday, May 8, 15
![Page 14: RabbitMQ](https://reader030.vdocuments.pub/reader030/viewer/2022032503/55beebacbb61eba92f8b45f3/html5/thumbnails/14.jpg)
Work Queues
P
C1
C2
Friday, May 8, 15
![Page 15: RabbitMQ](https://reader030.vdocuments.pub/reader030/viewer/2022032503/55beebacbb61eba92f8b45f3/html5/thumbnails/15.jpg)
Demo
Friday, May 8, 15
![Page 16: RabbitMQ](https://reader030.vdocuments.pub/reader030/viewer/2022032503/55beebacbb61eba92f8b45f3/html5/thumbnails/16.jpg)
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](https://reader030.vdocuments.pub/reader030/viewer/2022032503/55beebacbb61eba92f8b45f3/html5/thumbnails/17.jpg)
Exchange Types
• Fanout
• Direct
• Topic
Friday, May 8, 15
![Page 18: RabbitMQ](https://reader030.vdocuments.pub/reader030/viewer/2022032503/55beebacbb61eba92f8b45f3/html5/thumbnails/18.jpg)
Fanout Exchange
Friday, May 8, 15
![Page 19: RabbitMQ](https://reader030.vdocuments.pub/reader030/viewer/2022032503/55beebacbb61eba92f8b45f3/html5/thumbnails/19.jpg)
Direct Exchange
Friday, May 8, 15
![Page 20: RabbitMQ](https://reader030.vdocuments.pub/reader030/viewer/2022032503/55beebacbb61eba92f8b45f3/html5/thumbnails/20.jpg)
Topic Exchange
Friday, May 8, 15
![Page 21: RabbitMQ](https://reader030.vdocuments.pub/reader030/viewer/2022032503/55beebacbb61eba92f8b45f3/html5/thumbnails/21.jpg)
Demo
Friday, May 8, 15
![Page 22: RabbitMQ](https://reader030.vdocuments.pub/reader030/viewer/2022032503/55beebacbb61eba92f8b45f3/html5/thumbnails/22.jpg)
Adaption
P
C1
X
type=topicimage.resize
image.notify
image.publish.*
C1
image.publish.thumbnailC1
C1
Friday, May 8, 15
![Page 23: RabbitMQ](https://reader030.vdocuments.pub/reader030/viewer/2022032503/55beebacbb61eba92f8b45f3/html5/thumbnails/23.jpg)
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](https://reader030.vdocuments.pub/reader030/viewer/2022032503/55beebacbb61eba92f8b45f3/html5/thumbnails/24.jpg)
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