Class MessageProducerUtils

java.lang.Object
org.apache.beam.sdk.io.solace.broker.MessageProducerUtils

@Internal public class MessageProducerUtils extends Object
  • Constructor Details

    • MessageProducerUtils

      public MessageProducerUtils()
  • Method Details

    • createBytesXMLMessage

      public static BytesXMLMessage createBytesXMLMessage(Solace.Record record, boolean useCorrelationKeyLatency, DeliveryMode deliveryMode)
      Create a BytesXMLMessage to be published in Solace.
      Parameters:
      record - The record to be published.
      useCorrelationKeyLatency - Whether to use a complex key for tracking latency.
      deliveryMode - The DeliveryMode used to publish the message.
      Returns:
      A BytesXMLMessage that can be sent to Solace "as is".
    • createJCSMPSendMultipleEntry

      public static JCSMPSendMultipleEntry[] createJCSMPSendMultipleEntry(List<Solace.Record> records, boolean useCorrelationKeyLatency, SerializableFunction<Solace.Record,Destination> destinationFn, DeliveryMode deliveryMode)
      Create a JCSMPSendMultipleEntry array to be published in Solace. This can be used with `sendMultiple` to send all the messages in a single API call.

      The size of the list cannot be larger than 50 messages. This is a hard limit enforced by the Solace API.

      Parameters:
      records - A List of records to be published
      useCorrelationKeyLatency - Whether to use a complex key for tracking latency.
      destinationFn - A function that maps every record to its destination.
      deliveryMode - The DeliveryMode used to publish the message.
      Returns:
      A JCSMPSendMultipleEntry array that can be sent to Solace "as is".