Your SlideShare is downloading. ×
AMQP
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×

Introducing the official SlideShare app

Stunning, full-screen experience for iPhone and Android

Text the download link to your phone

Standard text messaging rates apply

AMQP

439
views

Published on

Published in: Technology

0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
439
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
19
Comments
0
Likes
1
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. • Message queueing• AMQP (Advanced Message Queueing Protocol)• Broker implementations• Use cases
  • 2. • Message queueing• AMQP (Advanced Message Queueing Protocol)• Broker implementations• Use cases
  • 3. Introduction to Messaging Message Queueing
  • 4. Why messaging? Messaging• Get data from point A to point B• Decouple publishers and consumers• Queueing for later delivery• Asynchronous• Load balancing and scalability
  • 5. Definition Message queues• are software-engineering components used for interprocess communication• provide an asynchronous communications protocol• have implicit or explicit limits on the size of data that may be transmitted in a single message
  • 6. The main features Message queueing• There are no direct connection between programs• Communication between programs can be time- independent• Work can be out by small, self-contained programs• Communication can be driven by events• Application can assign a priority to a message• Security• Data integrity• Recovery support
  • 7. AMQP Advanced Message Queueing Protocol
  • 8. Why? AMQP• Broadly applicable for enterprise• Totally open• Platform agnostic• Interoperable
  • 9. Protocol AMQP• Network wire-level protocol o Defines how clients and brokers talk o Data serialization (framing), heartbeat o Hidden inside client libraries• AMQP model o Defines routing and storing of messages o Defines rules how these are wired together o Exported API
  • 10. AboutNetwork wire-level protocol• Information is organized into "frames"• Independent threads of control within a single socket connection are called "channels"• For each channel, frames run in sequence• Each frame consists of header, payload, frame end packet• Frames can be protocol methods, structured content (message headers), data
  • 11. ModelAMQP
  • 12. Why?Virtual hosts• Created for administrative purposes• Access control• Each connection (and all channels inside) must be associated with a single virtual host• Each virtual host comprises its own name space, a set of exchanges, message queues and all associated objects
  • 13. DefinitionExchange• A message routing agent• Can be durable - lasts till explicitly deleted• Can be temporary - lasts till server shuts down• Can be auto-deleted - lasts till no longer used• There are several types of exchanges, each implements a particular algorythm• Each message is delivered to each qualifying queue• "Binding" - a link between queue and exchange
  • 14. Definition Direct exchange type• Uses string as routing key• Queue binds to exchange with key K• Publisher sends message with key R• Message is passed to this queue if K = R• Direct exchange named "amq.direct" is always pre-created in each virtual host
  • 15. RoutingDirect exchange
  • 16. Definition Fanout exchange type• No routing key• What goes in must go out• Can be used for load balancing
  • 17. RoutingFanout exchange
  • 18. Definition Topic exchange type• Uses pattern as routing key ("a.b.c.d")• Queues can use wildcard characters binding• * matches a single word, # - zero or more• "amq.topic" is pre-created in each vhost• *.stock.# matches usd.stock and eur.stock.db but not stock.nasdaq
  • 19. RoutingTopic exchange
  • 20. Details Message queue• named "weak FIFO" buffer• FIFO is guaranteed only with 1 consumer• Can be durable, temporary (private to 1 consumer) or auto-deleted• A message queue routed to queue is never sent to more than one client unless it is being resent after failure or rejection• You can get server to auto generate and assign queue name for your queue - this is usually done for private queues
  • 21. About Messages• Message is atomic unit of processing• Can be persistent (delivery guarantee in case network failure or server crash)• Can have a priority level
  • 22. Message contentMessages• Messages carry content (header + body)• Content body is opaque block of binary data• Broker never modifies content body• AMQP defines several "content classes", each with specific syntax (which headers can be used) and semantics (which methods are available for such messages)
  • 23. Thank you for attention by Karlen Kishmiryan (Sourcio CJSC)