Publishing Guaranteed Messages in the PubSub+ JCSMP API
A client application using the PubSub+ JCSMP API can publish Guaranteed messages, that is, messages that the client application assigns a Persistent or Non‑Persistent delivery mode to queue or topic destinations.
For a client to publish Guaranteed messages in a session, a producer flow to the host event broker is required. For the PubSub+ JCSMP API, a producer flow is created when an XMLMessageProducer
is acquired.
If a client disconnects, its publisher flow automatically expires if the client does not reconnect within three minutes.
The published Guaranteed messages have persistence because they are spooled, that is, they are written to persistent storage, to one of the following types of endpoints provisioned on the event broker:
- A queue that matches the messages’ queue destination.
- A queue that is assigned a topic subscription that matches the message’s topic destination.
- A topic endpoint that is assigned a topic subscription that matches the message’s topic destination.
For more information on endpoints and how to create them, refer to Receiving Guaranteed Messages in the PubSub+ JCSMP API.
It is also possible for messages published with a Direct delivery mode to be spooled to an endpoint when there is a match between the message’s topic destination and the topic subscription set for the endpoint. In this case, when the message is spooled to the endpoint, it is given a non‑persistent delivery mode so that a client can consume the message over its established Guaranteed message flow.
Consuming clients can receive Guaranteed messages when they bind to an endpoint by creating a Guaranteed messaging Flow to that endpoint. For information, refer to Receiving Guaranteed Messages in the PubSub+ JCSMP API.
The figure below shows the process of publishing and receiving Guaranteed messages.
Publishing Guaranteed Messages
Related Event Broker Provisioning and Configuration Information
For clients to publish messages to a Message VPN, the event broker must have Guaranteed Messaging and message spooling enabled. In addition, the clients must be assigned appropriately configured client profiles and/or Access Control List (ACL) profiles:
- To publish Guaranteed messages, clients must be assigned client profiles that have the
allow‑guaranteed‑message‑send
parameter enabled. - To allow clients to publish messages to topics (or to only a specific set of topics) clients must be assigned ACLs with the appropriate access controls.