Chapter 2. Understanding messaging

 

This chapter covers

  • Messaging concepts—consumers, producers, and brokers
  • AMQP elements—exchanges, queues, and bindings
  • Virtual hosts
  • Message durability
  • The life of a message from producer to consumer

When you say messaging, programmers think of a lot of different things. Email and IM come most readily to mind, but these models aren’t what we mean when we talk about messaging in terms of RabbitMQ. Messaging in RabbitMQ has some elements in common with email and IM, but is a completely different paradigm. For example, while AMQP, like email, stores messages for consumers who aren’t online, those messages are routed based on tags that are much more flexible. Also different from email, the messages have no set structure and can even store binary data directly. Unlike IM protocols, AMQP hides the sender and receiver from each other. There’s no concept of presence. As a result, you have a flexible infrastructure that encourages pervasive decoupling of your applications. AMQP messages can be routed one-to-many both in a broadcast pattern or selectively, as well as one-to-one. With IM you typically only get one-to-one.

2.1. Consumers and producers (not an economics lesson)

2.2. Building from the bottom: queues

2.3. Getting together: exchanges and bindings

2.4. Multiple tenants: virtual hosts and separation

2.5. Where’s my message? Durability and you

2.6. Putting it all together: a day in the life of a message

2.7. Using publisher confirms to verify delivery

2.8. Summary

sitemap