Class SolaceMessageProducer
java.lang.Object
org.apache.beam.sdk.io.solace.broker.SolaceMessageProducer
- All Implemented Interfaces:
MessageProducer
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Closes the message producer.boolean
isClosed()
Returns true if the message producer is closed, false otherwise.int
publishBatch
(List<Solace.Record> records, boolean useCorrelationKeyLatency, SerializableFunction<Solace.Record, Destination> destinationFn, DeliveryMode deliveryMode) Publishes a batch of messages to the broker.void
publishSingleMessage
(Solace.Record record, Destination topicOrQueue, boolean useCorrelationKeyLatency, DeliveryMode deliveryMode) Publishes a message to the broker.
-
Constructor Details
-
SolaceMessageProducer
-
-
Method Details
-
publishSingleMessage
public void publishSingleMessage(Solace.Record record, Destination topicOrQueue, boolean useCorrelationKeyLatency, DeliveryMode deliveryMode) Description copied from interface:MessageProducer
Publishes a message to the broker.- Specified by:
publishSingleMessage
in interfaceMessageProducer
-
publishBatch
public int publishBatch(List<Solace.Record> records, boolean useCorrelationKeyLatency, SerializableFunction<Solace.Record, Destination> destinationFn, DeliveryMode deliveryMode) Description copied from interface:MessageProducer
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.
- Specified by:
publishBatch
in interfaceMessageProducer
-
isClosed
public boolean isClosed()Description copied from interface:MessageProducer
Returns true if the message producer is closed, false otherwise.- Specified by:
isClosed
in interfaceMessageProducer
-
close
public void close()Description copied from interface:MessageProducer
Closes the message producer.- Specified by:
close
in interfaceMessageProducer
-