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 int |
messages |
protected boolean |
noWait |
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 |
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) |
protected B |
noWait() |
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 noWait
protected abstract B getThis()
protected B noWait()
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 abstract CO build()