Package com.rabbitmq.stream
Interface Producer
- All Superinterfaces:
AutoCloseable
API to send messages to a RabbitMQ Stream.
Instances are created and configured with a ProducerBuilder
.
Implementations are expected to be thread-safe, RabbitMQ Streams' are.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Close the producer.long
Get the last publishing ID for a named producer.Return aMessageBuilder
to create aMessage
.void
send
(Message message, ConfirmationHandler confirmationHandler) Publish a message.
-
Method Details
-
messageBuilder
MessageBuilder messageBuilder()Return aMessageBuilder
to create aMessage
.A
MessageBuilder
instance is meant to create onlyMessage
instance.- Returns:
- a single-usage
MessageBuilder
- See Also:
-
getLastPublishingId
long getLastPublishingId()Get the last publishing ID for a named producer.The value can be mapped to a business index to restart publishing where a previous incarnation of the producer left off.
- Returns:
- the last publishing ID for this named producer
-
send
Publish a message.- Parameters:
message
- the messageconfirmationHandler
- the callback when the message is confirmed or failed
-
close
void close()Close the producer.- Specified by:
close
in interfaceAutoCloseable
-