public static class FetchConsumeOptions.Builder extends BaseConsumeOptions.Builder<FetchConsumeOptions.Builder,FetchConsumeOptions>
bytes, expiresIn, messages, noWait, thresholdPercent| Constructor and Description |
|---|
Builder() |
| Modifier and Type | Method and Description |
|---|---|
FetchConsumeOptions |
build()
Build the FetchConsumeOptions.
|
protected FetchConsumeOptions.Builder |
getThis() |
FetchConsumeOptions.Builder |
max(int maxBytes,
int maxMessages)
Set maximum number of bytes or messages to fetch.
|
FetchConsumeOptions.Builder |
maxBytes(long maxBytes)
Set maximum number of bytes to fetch and remove any previously set
constraint
The number of bytes fetched will also be constrained by the expiration time. |
FetchConsumeOptions.Builder |
maxMessages(int maxMessages)
Set the maximum number of messages to fetch and remove any previously set
maxBytes(long) constraint. |
FetchConsumeOptions.Builder |
noWait()
Set no wait to true
|
FetchConsumeOptions.Builder |
noWaitExpiresIn(long expiresInMillis)
Set no wait to true with an expiration, special behavior.
|
bytes, expiresIn, json, jsonValue, messages, thresholdPercentprotected FetchConsumeOptions.Builder getThis()
getThis in class BaseConsumeOptions.Builder<FetchConsumeOptions.Builder,FetchConsumeOptions>public FetchConsumeOptions.Builder maxMessages(int maxMessages)
maxBytes(long) constraint.
The number of messages fetched will also be constrained by the expiration time.
Less than 1 means default of .
maxMessages - the number of messages.public FetchConsumeOptions.Builder maxBytes(long maxBytes)
constraint
The number of bytes fetched will also be constrained by the expiration time.
Less than 1 removes any previously set max bytes constraint.
It is important to set the byte size greater than your largest message payload, plus some amount to account for overhead, otherwise the consume process will stall if there are no messages that fit the criteria.
maxBytes - the maximum bytesMessage.consumeByteCount()public FetchConsumeOptions.Builder max(int maxBytes, int maxMessages)
Less than 1 max bytes removes any previously set max bytes constraint.
Less than 1 max messages removes any previously set max messages constraint.
It is important to set the byte size greater than your largest message payload, plus some amount to account for overhead, otherwise the consume process will stall if there are no messages that fit the criteria.
maxBytes - the maximum bytesmaxMessages - the maximum number of messagesMessage.consumeByteCount()public FetchConsumeOptions.Builder noWait()
noWait in class BaseConsumeOptions.Builder<FetchConsumeOptions.Builder,FetchConsumeOptions>public FetchConsumeOptions.Builder noWaitExpiresIn(long expiresInMillis)
expiresInMillis - the expiration time in millisecondspublic FetchConsumeOptions build()
build in class BaseConsumeOptions.Builder<FetchConsumeOptions.Builder,FetchConsumeOptions>