Publish/Subscribe
In this chapter, we let the broker copy one message to every service that acts on it, so that we can add a service without changing the one that sends the message.
After reading this chapter, you should be able to:
- Decide whether work between two services should go through a queue
- Explain why point-to-point messaging makes the sender know every receiver’s queue
- Explain how a broker copies a message to every queue on a topic’s list
- Define topic, publisher, subscriber, and publish/subscribe
- Add a subscriber or a topic without changing the publisher
- Explain competing consumers, and when every instance of a service needs its own copy
- Distinguish publish/subscribe from asynchronous processing by three kinds of independence
- Compare three ways brokers build publish/subscribe
- Define event stream, stream processing, and batch processing
- Explain the cost of publish/subscribe, and decide when to use it
- Recognize publish/subscribe in webhooks and push notifications
Sections
- Shipping a Placed Order
- One Queue or Three
- The Broker Makes the Copies
- Publish/Subscribe
- Adding a Subscriber
- Instances of a Subscriber
- Publish/Subscribe and Asynchronous Processing
- How Brokers Build Publish/Subscribe
- Event Streams
- Following an Order Through the System
- Webhooks and Push Notifications