public class ConsumerConfiguration
extends java.lang.Object
implements io.nats.client.support.JsonSerializable
ConsumerConfiguration is intended to be used with JetStreamManagement.createConsumer().
By default this will create a pull consumer unless ConsumerConfiguration.Builder.deliverSubject(String) is set.
| Modifier and Type | Class and Description |
|---|---|
static class |
ConsumerConfiguration.Builder
ConsumerConfiguration is created using a Builder.
|
| Modifier and Type | Field and Description |
|---|---|
static AckPolicy |
DEFAULT_ACK_POLICY
The default ack policy for consumers
|
static DeliverPolicy |
DEFAULT_DELIVER_POLICY
The default deliver policy for consumers
|
static PriorityPolicy |
DEFAULT_PRIORITY_POLICY
The default priority policy for consumers
|
static ReplayPolicy |
DEFAULT_REPLAY_POLICY
The default replay policy for consumers
|
static java.time.Duration |
DURATION_MIN
Deprecated.
|
static long |
DURATION_MIN_LONG
Constant used to unset a Duration setting in the builder
|
static java.time.Duration |
DURATION_UNSET
Constant used to unset a Duration setting in the builder
|
static long |
DURATION_UNSET_LONG
Constant used to unset a long setting in the builder
|
static int |
INTEGER_UNSET
Constant used to unset a Duration setting in the builder
|
static long |
LONG_UNSET
Constant used to unset a long setting in the builder
|
static int |
MAX_DELIVER_MIN
Constant representing the minimum max deliver
|
static java.time.Duration |
MIN_IDLE_HEARTBEAT
The minimum allowed idle heartbeat setting
|
static long |
MIN_IDLE_HEARTBEAT_MILLIS
Constant representing the minimum idle heartbeat in milliseconds
|
static long |
MIN_IDLE_HEARTBEAT_NANOS
Constant representing the minimum idle heartbeat in nanos
|
static int |
STANDARD_MIN
Constant used to as a standard minimum value
|
static long |
ULONG_UNSET
Constant used to unset a long that represents an unsigned long setting in the builder
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
ackPolicyWasSet()
Gets whether ack policy for this consumer configuration was set or left unset
|
boolean |
backoffWasSet()
Gets whether backoff for this consumer configuration was set or left unset
|
static ConsumerConfiguration.Builder |
builder()
Creates a builder for the options.
|
static ConsumerConfiguration.Builder |
builder(ConsumerConfiguration cc)
Creates a builder for the options.
|
boolean |
deliverPolicyWasSet()
Gets whether deliver policy of this consumer configuration was set or left unset
|
boolean |
flowControlWasSet()
Gets whether flow control for this consumer configuration was set or left unset
|
@NonNull AckPolicy |
getAckPolicy()
Gets the acknowledgment policy of this consumer configuration.
|
@Nullable java.time.Duration |
getAckWait()
Gets the acknowledgment wait of this consumer configuration.
|
@NonNull java.util.List<java.time.Duration> |
getBackoff()
Get the backoff list; may be empty, will never be null.
|
@Nullable java.lang.String |
getDeliverGroup()
Gets the deliver group of this consumer configuration.
|
@NonNull DeliverPolicy |
getDeliverPolicy()
Gets the deliver policy of this consumer configuration.
|
@Nullable java.lang.String |
getDeliverSubject()
Gets the deliver subject of this consumer configuration.
|
@Nullable java.lang.String |
getDescription()
Gets the name of the description of this consumer configuration.
|
@Nullable java.lang.String |
getDurable()
Gets the name of the durable name for this consumer configuration.
|
@Nullable java.lang.String |
getFilterSubject()
Gets the filter subject of this consumer configuration.
|
@Nullable java.util.List<java.lang.String> |
getFilterSubjects()
Gets the filter subjects as a list.
|
@Nullable java.time.Duration |
getIdleHeartbeat()
Gets the idle heart beat wait time
|
@Nullable java.time.Duration |
getInactiveThreshold()
Get the amount of time before the consumer is deemed inactive.
|
long |
getMaxAckPending()
Gets the maximum ack pending configuration.
|
long |
getMaxBatch()
Get the max batch size for the server to allow on pull requests.
|
long |
getMaxBytes()
Get the max bytes size for the server to allow on pull requests.
|
long |
getMaxDeliver()
Gets the max delivery amount of this consumer configuration.
|
@Nullable java.time.Duration |
getMaxExpires()
Get the max amount of expire time for the server to allow on pull requests.
|
long |
getMaxPullWaiting()
Get the number of pulls that can be outstanding on a pull consumer
|
@NonNull java.util.Map<java.lang.String,java.lang.String> |
getMetadata()
Metadata for the consumer; may be empty, will never be null.
|
@Nullable java.lang.String |
getName()
Gets the name of the consumer name for this consumer configuration.
|
int |
getNumReplicas()
Get the number of consumer replicas.
|
@Nullable java.time.ZonedDateTime |
getPauseUntil()
Get the time until the consumer is paused.
|
@Nullable java.util.List<java.lang.String> |
getPriorityGroups()
Gets the priority groups as a list.
|
@NonNull PriorityPolicy |
getPriorityPolicy()
Gets the priority policy of this consumer configuration.
|
@Nullable java.time.Duration |
getPriorityTimeout()
For pinned_client priority policy how long before the client times out
|
long |
getRateLimit()
Gets the rate limit for this consumer configuration.
|
@NonNull ReplayPolicy |
getReplayPolicy()
Gets the replay policy of this consumer configuration.
|
@Nullable java.lang.String |
getSampleFrequency()
Gets the sample frequency.
|
long |
getStartSequence()
Gets the start sequence of this consumer configuration.
|
@Nullable java.time.ZonedDateTime |
getStartTime()
Gets the start time of this consumer configuration.
|
boolean |
hasMultipleFilterSubjects()
Whether there are multiple filter subjects for this consumer configuration.
|
boolean |
headersOnlyWasSet()
Gets whether headers only for this consumer configuration was set or left unset
|
boolean |
isFlowControl()
Get the flow control flag indicating whether it's on or off
|
boolean |
isHeadersOnly()
Get the header only flag indicating whether it's on or off
|
boolean |
isMemStorage()
Get the mem storage flag whether it's on or off.
|
boolean |
maxAckPendingWasSet()
Gets whether max ack pending for this consumer configuration was set or left unset
|
boolean |
maxBatchWasSet()
Gets whether max batch for this consumer configuration was set or left unset
|
boolean |
maxBytesWasSet()
Gets whether max bytes for this consumer configuration was set or left unset
|
boolean |
maxDeliverWasSet()
Gets whether max deliver for this consumer configuration was set or left unset
|
boolean |
maxPullWaitingWasSet()
Gets whether max pull waiting for this consumer configuration was set or left unset
|
boolean |
memStorageWasSet()
Gets whether mem storage for this consumer configuration was set or left unset
|
boolean |
metadataWasSet()
Gets whether metadata for this consumer configuration was set or left unset
|
boolean |
numReplicasWasSet()
Gets whether num replicas for this consumer configuration was set or left unset
|
boolean |
priorityPolicyWasSet()
Gets whether priority policy for this consumer configuration was set or left unset
|
boolean |
priorityTimeoutWasSet()
Gets whether priority timeout for this consumer configuration was set or left unset
|
boolean |
rateLimitWasSet()
Gets whether rate limit for this consumer configuration was set or left unset
|
boolean |
replayPolicyWasSet()
Gets whether replay policy for this consumer configuration was set or left unset
|
boolean |
startSeqWasSet()
Gets whether start sequence for this consumer configuration was set or left unset
|
@NonNull java.lang.String |
toJson()
Returns a JSON representation of this consumer configuration.
|
java.lang.String |
toString() |
public static final DeliverPolicy DEFAULT_DELIVER_POLICY
public static final AckPolicy DEFAULT_ACK_POLICY
public static final ReplayPolicy DEFAULT_REPLAY_POLICY
public static final PriorityPolicy DEFAULT_PRIORITY_POLICY
public static final java.time.Duration MIN_IDLE_HEARTBEAT
public static final java.time.Duration DURATION_UNSET
public static final int INTEGER_UNSET
public static final long LONG_UNSET
public static final long ULONG_UNSET
public static final long DURATION_UNSET_LONG
public static final long DURATION_MIN_LONG
public static final int STANDARD_MIN
public static final int MAX_DELIVER_MIN
public static final long MIN_IDLE_HEARTBEAT_NANOS
public static final long MIN_IDLE_HEARTBEAT_MILLIS
@Deprecated public static final java.time.Duration DURATION_MIN
public @NonNull java.lang.String toJson()
toJson in interface io.nats.client.support.JsonSerializablepublic @Nullable java.lang.String getDescription()
public @Nullable java.lang.String getDurable()
public @Nullable java.lang.String getName()
public @Nullable java.lang.String getDeliverSubject()
public @Nullable java.lang.String getDeliverGroup()
public @NonNull DeliverPolicy getDeliverPolicy()
public long getStartSequence()
public @Nullable java.time.ZonedDateTime getStartTime()
public @NonNull AckPolicy getAckPolicy()
public @Nullable java.time.Duration getAckWait()
public long getMaxDeliver()
public @Nullable java.lang.String getFilterSubject()
public @Nullable java.util.List<java.lang.String> getFilterSubjects()
public @Nullable java.util.List<java.lang.String> getPriorityGroups()
public boolean hasMultipleFilterSubjects()
public @NonNull ReplayPolicy getReplayPolicy()
public long getRateLimit()
public long getMaxAckPending()
public @Nullable java.lang.String getSampleFrequency()
public @Nullable java.time.Duration getIdleHeartbeat()
public boolean isFlowControl()
public long getMaxPullWaiting()
public boolean isHeadersOnly()
public boolean isMemStorage()
public long getMaxBatch()
public long getMaxBytes()
public @Nullable java.time.Duration getMaxExpires()
public @Nullable java.time.Duration getInactiveThreshold()
public @NonNull java.util.List<java.time.Duration> getBackoff()
public @NonNull java.util.Map<java.lang.String,java.lang.String> getMetadata()
public int getNumReplicas()
public @Nullable java.time.ZonedDateTime getPauseUntil()
public @NonNull PriorityPolicy getPriorityPolicy()
public @Nullable java.time.Duration getPriorityTimeout()
public boolean deliverPolicyWasSet()
public boolean ackPolicyWasSet()
public boolean replayPolicyWasSet()
public boolean startSeqWasSet()
public boolean maxDeliverWasSet()
public boolean rateLimitWasSet()
public boolean maxAckPendingWasSet()
public boolean maxPullWaitingWasSet()
public boolean maxBatchWasSet()
public boolean maxBytesWasSet()
public boolean flowControlWasSet()
public boolean headersOnlyWasSet()
public boolean memStorageWasSet()
public boolean numReplicasWasSet()
public boolean backoffWasSet()
public boolean metadataWasSet()
public boolean priorityPolicyWasSet()
public boolean priorityTimeoutWasSet()
public static ConsumerConfiguration.Builder builder()
public static ConsumerConfiguration.Builder builder(ConsumerConfiguration cc)
cc - the consumer configurationpublic java.lang.String toString()
toString in class java.lang.Object