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 sequence of the publish
|
PublishOptions.Builder |
expectedLastSubjectSequence(long sequence)
Sets the expected subject message sequence of the publish
|
PublishOptions.Builder |
expectedLastSubjectSequenceSubject(java.lang.String expectedLastSubSeqSubject)
Sets the filter subject for the expected last subject sequence
This can be used for a wildcard since it is used
in place of the message subject along with expectedLastSubjectSequence
|
PublishOptions.Builder |
expectedStream(java.lang.String stream)
Sets the expected stream for the publish.
|
PublishOptions.Builder |
messageId(java.lang.String msgId)
Sets the message id.
|
PublishOptions.Builder |
messageTtl(MessageTtl messageTtl)
Sets the TTL for this specific message to be published
|
PublishOptions.Builder |
messageTtlCustom(java.lang.String msgTtlCustom)
Sets the TTL for this specific message to be published.
|
PublishOptions.Builder |
messageTtlNever()
Sets the TTL for this specific message to be published and never be expired
|
PublishOptions.Builder |
messageTtlSeconds(int msgTtlSeconds)
Sets the TTL for this specific message to be published.
|
PublishOptions.Builder |
stream(java.lang.String stream)
Deprecated.
Not a very useful function
Sets the stream name to expect the pub ack to have.
This really should never be an issue and it does
not prevent the message from being published,
it's an exception after the fact
|
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 - properties@Deprecated public 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 expectedLastSubjectSequence(long sequence)
sequence - the expected last subject sequence numberpublic PublishOptions.Builder expectedLastSubjectSequenceSubject(java.lang.String expectedLastSubSeqSubject)
expectedLastSubSeqSubject - the filter subjectpublic PublishOptions.Builder messageId(java.lang.String msgId)
msgId - the unique message id.public PublishOptions.Builder messageTtlSeconds(int msgTtlSeconds)
msgTtlSeconds - the ttl in secondspublic PublishOptions.Builder messageTtlCustom(java.lang.String msgTtlCustom)
msgTtlCustom - the custom ttl stringpublic PublishOptions.Builder messageTtlNever()
public PublishOptions.Builder messageTtl(MessageTtl messageTtl)
messageTtl - the message ttl instancepublic PublishOptions.Builder clearExpected()
public PublishOptions build()