public static class PublishOptions.Builder
extends java.lang.Object
| Constructor and Description |
|---|
Builder()
Constructs a new publish options Builder with the default values.
|
Builder(java.util.Properties properties)
Constructs a builder from properties
|
| Modifier and Type | Method and Description |
|---|---|
PublishOptions |
build()
Builds the publish options.
|
PublishOptions.Builder |
clearExpected()
Clears the expected so the build can be re-used.
|
PublishOptions.Builder |
expectedLastMsgId(java.lang.String lastMsgId)
Sets the expected last ID of the previously published message.
|
PublishOptions.Builder |
expectedLastSequence(long sequence)
Sets the expected message ID of the publish
|
PublishOptions.Builder |
expectedStream(java.lang.String stream)
Sets the expected stream of the publish.
|
PublishOptions.Builder |
messageId(java.lang.String msgId)
Sets the message id.
|
PublishOptions.Builder |
stream(java.lang.String stream)
Sets the stream name for publishing.
|
PublishOptions.Builder |
streamTimeout(java.time.Duration timeout)
Sets the timeout to wait for a publish acknowledgement from a JetStream
enabled NATS server.
|
public Builder()
public Builder(java.util.Properties properties)
properties - propertiespublic PublishOptions.Builder stream(java.lang.String stream)
stream - The name of the stream.public PublishOptions.Builder streamTimeout(java.time.Duration timeout)
timeout - the publish timeout.public PublishOptions.Builder expectedStream(java.lang.String stream)
stream - expected streampublic PublishOptions.Builder expectedLastMsgId(java.lang.String lastMsgId)
lastMsgId - the streampublic PublishOptions.Builder expectedLastSequence(long sequence)
sequence - the expected last sequence numberpublic PublishOptions.Builder messageId(java.lang.String msgId)
msgId - the unique message id.public PublishOptions.Builder clearExpected()
public PublishOptions build()