Receiving Messages
The PubSub+ Messaging API for Python allows clients to consume messages published to any topics they are subscribed to.
Receivers can consume messages from the event broker in the following ways:
- Direct messaging provides a reliable, but not guaranteed delivery of messages from publishing clients to receiving clients. Direct messages are sent at most once. Direct messages can be delivered to a client in a session when the event broker has matching topic subscriptions for that client. Direct messages differ from persistent messages as they:
- are sent at most once
- are not retained for a client when that client is not connected to an event broker
- can be discarded when congestion or system failures are encountered
- are not acknowledged upon delivery
- Persistent messaging (also referred to as guaranteed messages) can be used to ensure the delivery of a message between two applications. Persistent messages are delivered at least once and are useful in scenarios where the receiving application may disconnect, but cannot tolerate message loss.
- To receive persistent messages, a client must create a consumer flow to bind to a durable or non-durable queue on the event broker where the published messages are stored on a message spool. After the client application is bound to the queue, and it has an active consumer flow (that is, a flow through which messages are being delivered), it can consume persistent messages from the queue.