protected abstract static class BaseConsumeOptions.Builder<B,CO>
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected long |
bytes |
protected long |
expiresIn |
protected java.lang.String |
group |
protected int |
messages |
protected long |
minAckPending |
protected long |
minPending |
protected boolean |
raiseStatusWarnings |
protected int |
thresholdPercent |
Modifier | Constructor and Description |
---|---|
protected |
Builder() |
Modifier and Type | Method and Description |
---|---|
abstract CO |
build()
Build the options.
|
protected B |
bytes(long bytes) |
B |
expiresIn(long expiresInMillis)
In Fetch, sets the maximum amount of time to wait to reach the batch size or max byte.
|
protected abstract B |
getThis() |
B |
group(java.lang.String group)
Sets the group
|
B |
json(java.lang.String json)
Initialize values from the json string.
|
B |
jsonValue(JsonValue jsonValue)
Initialize values from the JsonValue object.
|
protected B |
messages(int messages) |
B |
minAckPending(long minAckPending)
When specified, the consumer will only receive messages when the consumer has at least this many ack pending messages.
|
B |
minPending(long minPending)
When specified, the consumer will only receive messages when the consumer has at least this many pending messages.
|
B |
raiseStatusWarnings()
Raise status warning turns on sending status messages to the error listener.
|
B |
raiseStatusWarnings(boolean raiseStatusWarnings)
Turn on or off raise status warning turns.
|
B |
thresholdPercent(int thresholdPercent)
Set the threshold percent of max bytes (if max bytes is specified) or messages
that will trigger issuing pull requests to keep messages flowing.
|
protected int messages
protected long bytes
protected int thresholdPercent
protected long expiresIn
protected boolean raiseStatusWarnings
protected java.lang.String group
protected long minPending
protected long minAckPending
protected abstract B getThis()
public B json(java.lang.String json) throws JsonParseException
json
- the json string to parseJsonParseException
- if the json is invalidpublic B jsonValue(JsonValue jsonValue)
jsonValue
- the json value objectprotected B messages(int messages)
protected B bytes(long bytes)
public B expiresIn(long expiresInMillis)
Zero or less will default to , otherwise, cannot be less than
expiresInMillis
- the expiration time in millisecondspublic B thresholdPercent(int thresholdPercent)
Only applies to endless consumes.
For instance if the batch size is 100 and the re-pull percent is 25, the first pull will be for 100, and then when 25 messages have been received another 75 will be requested, keeping the number of messages in transit always at 100.
Must be between 1 and 100 inclusive. Less than 1 will assume the default of . Greater than 100 will assume 100.
thresholdPercent
- the threshold percentpublic B raiseStatusWarnings()
public B raiseStatusWarnings(boolean raiseStatusWarnings)
public B group(java.lang.String group)
group
- the priority group for this pullpublic B minPending(long minPending)
minPending
- the min pendingpublic B minAckPending(long minAckPending)
minAckPending
- the min ack pendingpublic abstract CO build()