Publishing Messages

The PubSub+ Messaging API for Java allows client applications to publish messages to an SMF (Solace Message Format) topic via the event broker. The message are then consumed by receivers subscribed to that topic.

You can publish messages to the event broker in the following ways:

Publishing Direct Messages Using the Java API

Direct messages provide a reliable, but not guaranteed, delivery of messages from publishing clients to receiving clients. Messages are sent exactly once. Direct messages are published to a topic destination and are routed to receiving clients with matching topic subscriptions. Direct messages differ from persistent messages as they:

  • are sent only 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

Publish using Persistent Messages

Persistent messages (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. Persistent messages are delivered in the order they were published. A client application can publish persistent messages (messages with persistent delivery mode) to topic destinations that have been mapped to a queue.