Topic Endpoints and Queues
Guaranteed messages are stored in endpoints on the event broker. There are two types of endpoints:
- Queues—A queue is an endpoint configured with topic subscriptions that clients can publish messages to and consume messages from. Queues can subscribe to more than one topic and receive messages for all topics matching their subscriptions. Queues can provide exclusive access to one consumer or access to multiple consumers where messages are distributed among the consumers.
- Topic Endpoints—A topic endpoint attracts messages published to a single topic for which the topic endpoint has a matching subscription. Any topic endpoint whose topic subscription matches the topic on the incoming messages will receive those messages.
Queues are significantly more flexible than topic endpoints and are the recommended approach for most applications. Queues support multiple topic subscriptions and they are highly configurable with a variety of options to match different application needs. Topic endpoints should be used only with JMS applications.
Queues on an event broker work very much like queues in all message queuing systems:
- Producers send Guaranteed messages to the event broker.
- The messages are saved in the queue and delivered to consuming clients if they are online and connected or held in the queue until the consumer connects.
- The consumer acknowledges the message once it has completed processing it
- The event broker removes the message from the queue.
Queues can be durable or non-durable:
- Durable queues exist until they are removed by an administrative action. They accumulate messages whether clients are online or offline. When offline clients reconnect, they receive all of the messages that accumulated while they were offline.
- Temporary (or non-durable) queues follow the lifecycle of the client connection and are useful for ensuring message persistence while clients are online. Temporary queues and topic endpoints last only as long as the client’s session is connected. If a client disconnects for a period of time, the event broker automatically removes the temporary queues and messages do not accumulate while clients are offline.
For more information, see Queues and Topic Endpoints and Understanding Solace Endpoints: Queues vs. Topic Endpoints in the Solace Blog.
Message Replay
Message replay allows an event broker to resend messages to new or existing clients that request them, hours or even days after those messages were first received by the event broker. Replay can be performed on a queue or topic endpoint. If you enable message replay, event brokers store Guaranteed messages in a replay log. These messages are kept until the log is full, after which the oldest messages are removed to free-up space for new messages. For more information, see Message Replay
Now that we've covered the basics of how event brokers get event data from the publishing application to the clients that want to know about it, you can learn about Message VPNs on software event brokers and appliances, or jump ahead to learn more about how an event mesh can expand EDA functionality for enterprises in Understanding Event Meshes.