Interface MessageProducer

All Known Implementing Classes:
SolaceMessageProducer

@Internal public interface MessageProducer
Base class for publishing messages to a Solace broker.

Implementations of this interface are responsible for managing the connection to the broker and for publishing messages to the broker.

  • Method Details

    • publishSingleMessage

      void publishSingleMessage(Solace.Record msg, Destination topicOrQueue, boolean useCorrelationKeyLatency, DeliveryMode deliveryMode)
      Publishes a message to the broker.
    • publishBatch

      int publishBatch(List<Solace.Record> records, boolean useCorrelationKeyLatency, SerializableFunction<Solace.Record,Destination> destinationFn, DeliveryMode deliveryMode)
      Publishes a batch of messages to the broker.

      The size of the batch cannot exceed 50 messages, this is a limitation of the Solace API.

      It returns the number of messages written.

    • isClosed

      boolean isClosed()
      Returns true if the message producer is closed, false otherwise.
    • close

      void close()
      Closes the message producer.