public static final class SubscriptionOptions.Builder extends Object
SubscriptionOptions object.| Constructor and Description |
|---|
Builder() |
| Modifier and Type | Method and Description |
|---|---|
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 |
setAckWait(Duration ackWait)
Sets the amount of time the subscription will wait for ACKs from the cluster.
|
SubscriptionOptions.Builder |
setAckWait(long ackWait,
TimeUnit unit)
Sets the amount of time the subscription will wait for ACKs from the cluster.
|
SubscriptionOptions.Builder |
setDurableName(String durableName)
Sets the durable subscriber name for the subscription.
|
SubscriptionOptions.Builder |
setManualAcks(boolean manualAcks)
Sets whether or not messages must be acknowledge individually by calling
Message.ack(). |
SubscriptionOptions.Builder |
setMaxInFlight(int maxInFlight)
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(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 - the name of the durable subscriberpublic SubscriptionOptions.Builder setMaxInFlight(int maxInFlight)
maxInFlight - the maximum number of in-flight messagespublic SubscriptionOptions.Builder setAckWait(Duration ackWait)
ackWait - the amount of time the subscription will wait for an ACK from the clusterpublic SubscriptionOptions.Builder setAckWait(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)
Message.ack().manualAcks - whether or not messages must be manually acknowledgedpublic 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 Apcera, Inc.. All rights reserved.