public static final class SubscriptionOptions.Builder
extends java.lang.Object
implements java.io.Serializable
SubscriptionOptions object.| Constructor and Description |
|---|
Builder() |
| Modifier and Type | Method and Description |
|---|---|
SubscriptionOptions.Builder |
ackWait(java.time.Duration ackWait)
Sets the amount of time the subscription will wait for ACKs from the cluster.
|
SubscriptionOptions.Builder |
ackWait(long ackWait,
java.util.concurrent.TimeUnit unit)
Sets the amount of time the subscription will wait for ACKs from the cluster.
|
SubscriptionOptions |
build()
Creates a
SubscriptionOptions instance based on the current configuration. |
SubscriptionOptions.Builder |
deliverAllAvailable()
Specifies that message delivery should begin at the oldest available message for this
subject.
|
SubscriptionOptions.Builder |
dispatcher(java.lang.String dispatcherName)
Specify a dispatcher for this subscription.
|
SubscriptionOptions.Builder |
durableName(java.lang.String durableName)
Sets the durable subscriber name for the subscription.
|
SubscriptionOptions.Builder |
manualAcks()
Sets whether or not messages must be acknowledge individually by calling
Message.ack(). |
SubscriptionOptions.Builder |
maxInFlight(int max)
Sets the maximum number of in-flight (unacknowledged) messages for the subscription.
|
SubscriptionOptions.Builder |
startAtSequence(long seq)
Specifies the sequence number from which to start receiving messages.
|
SubscriptionOptions.Builder |
startAtTime(java.time.Instant start)
Specifies the desired start time position using
java.time.Instant. |
SubscriptionOptions.Builder |
startAtTimeDelta(java.time.Duration ago)
Specifies the desired delta start time as a
Duration. |
SubscriptionOptions.Builder |
startAtTimeDelta(long ago,
java.util.concurrent.TimeUnit unit)
Specifies the desired delta start time position in the desired unit.
|
SubscriptionOptions.Builder |
startWithLastReceived()
Specifies that message delivery should start with the last (most recent) message stored
for this subject.
|
SubscriptionOptions.Builder |
subscriptionTimeout(java.time.Duration timeout)
Sets the amount of time the subscription will wait during creation on a network failure.
|
public SubscriptionOptions.Builder durableName(java.lang.String durableName)
durableName - the name of the durable subscriberpublic SubscriptionOptions.Builder maxInFlight(int max)
max - the maximum number of in-flight messagespublic SubscriptionOptions.Builder subscriptionTimeout(java.time.Duration timeout)
timeout - the amount of time the subscription will wait to be createdpublic SubscriptionOptions.Builder ackWait(java.time.Duration ackWait)
ackWait - the amount of time the subscription will wait for an ACK from the clusterpublic SubscriptionOptions.Builder ackWait(long ackWait, java.util.concurrent.TimeUnit unit)
ackWait - the amount of time the subscription will wait for an ACK from the clusterunit - the time unitpublic SubscriptionOptions.Builder manualAcks()
Message.ack().public SubscriptionOptions.Builder startAtSequence(long seq)
seq - the sequence number from which to start receiving messagespublic SubscriptionOptions.Builder startAtTime(java.time.Instant start)
java.time.Instant.start - the desired start time position expressed as a java.time.Instantpublic SubscriptionOptions.Builder startAtTimeDelta(long ago, java.util.concurrent.TimeUnit unit)
ago - the historical time delta (from now) from which to start receiving messagesunit - the time unitpublic SubscriptionOptions.Builder startAtTimeDelta(java.time.Duration ago)
Duration.ago - the historical time delta (from now) from which to start receiving messagespublic SubscriptionOptions.Builder startWithLastReceived()
public SubscriptionOptions.Builder deliverAllAvailable()
public SubscriptionOptions.Builder dispatcher(java.lang.String dispatcherName)
dispatcherName - the shared name to use for the dispatcherpublic SubscriptionOptions build()
SubscriptionOptions instance based on the current configuration.SubscriptionOptions instance