public static final class SubscriptionOptions.Builder extends Object implements Serializable
SubscriptionOptions object.| Constructor and Description |
|---|
Builder() |
| Modifier and Type | Method and Description |
|---|---|
SubscriptionOptions.Builder |
ackWait(Duration ackWait)
Sets the amount of time the subscription will wait for ACKs from the cluster.
|
SubscriptionOptions.Builder |
ackWait(long ackWait,
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 |
durableName(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 |
setAckWait(Duration ackWait)
Deprecated.
use
ackWait(Duration) instead |
SubscriptionOptions.Builder |
setAckWait(long ackWait,
TimeUnit unit)
Deprecated.
use
ackWait(long, TimeUnit) instead |
SubscriptionOptions.Builder |
setDurableName(String durableName)
Deprecated.
Use
durableName(String) instead |
SubscriptionOptions.Builder |
setManualAcks(boolean manualAcks)
Deprecated.
use
manualAcks() instead |
SubscriptionOptions.Builder |
setMaxInFlight(int max)
Deprecated.
Use
maxInFlight(int) instead |
SubscriptionOptions.Builder |
startAtSequence(long seq)
Specifies the sequence number from which to start receiving messages.
|
SubscriptionOptions.Builder |
startAtTime(Instant start)
Specifies the desired start time position using
java.time.Instant. |
SubscriptionOptions.Builder |
startAtTimeDelta(Duration ago)
Specifies the desired delta start time as a
Duration. |
SubscriptionOptions.Builder |
startAtTimeDelta(long ago,
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.
|
public SubscriptionOptions.Builder setDurableName(String durableName)
durableName(String) insteaddurableName - the name of the durable subscriberpublic SubscriptionOptions.Builder durableName(String durableName)
durableName - the name of the durable subscriberpublic SubscriptionOptions.Builder setMaxInFlight(int max)
maxInFlight(int) insteadmax - maximum number of in-flight messagespublic SubscriptionOptions.Builder maxInFlight(int max)
max - the maximum number of in-flight messagespublic SubscriptionOptions.Builder setAckWait(Duration ackWait)
ackWait(Duration) insteadackWait - the amount of time the subscription will wait for an ACK from the clusterpublic SubscriptionOptions.Builder setAckWait(long ackWait, TimeUnit unit)
ackWait(long, TimeUnit) insteadackWait - the amount of time the subscription will wait for an ACK from the clusterunit - the time unitpublic SubscriptionOptions.Builder ackWait(Duration ackWait)
ackWait - the amount of time the subscription will wait for an ACK from the clusterpublic SubscriptionOptions.Builder ackWait(long ackWait, TimeUnit unit)
ackWait - the amount of time the subscription will wait for an ACK from the clusterunit - the time unitpublic SubscriptionOptions.Builder setManualAcks(boolean manualAcks)
manualAcks() insteadMessage.ack().manualAcks - whether or not messages must be manually acknowledgedpublic SubscriptionOptions.Builder manualAcks()
Message.ack().public SubscriptionOptions.Builder startAtSequence(long seq)
seq - the sequence number from which to start receiving messagespublic SubscriptionOptions.Builder startAtTime(Instant start)
java.time.Instant.start - the desired start time position expressed as a java.time.Instantpublic SubscriptionOptions.Builder startAtTimeDelta(long ago, TimeUnit unit)
ago - the historical time delta (from now) from which to start receiving messagesunit - the time unitpublic SubscriptionOptions.Builder startAtTimeDelta(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 build()
SubscriptionOptions instance based on the current configuration.SubscriptionOptions instanceCopyright © 2016–2018 NATS.io. All rights reserved.