The figure below shows the basic steps of the Guaranteed Messaging process.
Guaranteed Message Steps
- A client application that has connected to a Message VPN on a Solace router publishes a Guaranteed message (that is, a message with a delivery mode of persistent or non-persistent) to a topic or queue destination.
- This ingress message received by the router is spooled to a queue or topic endpoint.
- An acknowledgment that the message has been spooled successfully is sent back to the publishing client.
- The router can deliver the spooled message to a consuming client if:
- that client has successfully established a connection to the same Message VPN;
- is authorized to receive Guaranteed messages;
- has created a consumer flow in that session to bind to the endpoint;
- and its flow is chosen to be the active flow for the endpoint (that is, it is the flow out of all of flows currently bound to that endpoint that can deliver messages)
- After the router delivers the message to the consumer, an acknowledgment that the message has been delivered successfully is sent back to the router by the consuming client, and then the router deletes the message from the message spool.
For more information on the message spooling and acknowledgment process mechanism, refer to Message Spooling.
When applications are using Solace APIs, a session is used to provide a client connection between an application and a Solace router. A session uses a single TCP connection to the Solace router. A session is required for all client messaging operations: for example, a session is required to publish Guaranteed messages, and a session is required to create a consumer flow through which Guaranteed messages can be received.
A consumer flow can be created in a session to establish a one‑to‑one mapping of a consumer to a queue or topic endpoint. Consumer flows provide a means of transport for Guaranteed messages from the router to the consumer. One or more consumer flows can be created in a session.
Note: Consumer flows are not used to receive Direct messages. Instead, clients receive Direct messages published to a topic that matches the clients’ subscriptions directly from the router’s message bus through sessions.