public static class ConsumeOptions.Builder extends BaseConsumeOptions.Builder<ConsumeOptions.Builder,ConsumeOptions>
bytes, expiresIn, group, messages, minAckPending, minPending, raiseStatusWarnings, thresholdPercent
Constructor and Description |
---|
Builder() |
Modifier and Type | Method and Description |
---|---|
ConsumeOptions.Builder |
batchBytes(long batchBytes)
Set the initial batch size in bytes and remove any previously set batch message constraint.
|
ConsumeOptions.Builder |
batchSize(int batchSize)
Set the initial batch size in messages and remove any previously set
batchBytes(long) constraint. |
ConsumeOptions |
build()
Build the ConsumeOptions.
|
protected ConsumeOptions.Builder |
getThis() |
bytes, expiresIn, group, json, jsonValue, messages, minAckPending, minPending, raiseStatusWarnings, raiseStatusWarnings, thresholdPercent
protected ConsumeOptions.Builder getThis()
getThis
in class BaseConsumeOptions.Builder<ConsumeOptions.Builder,ConsumeOptions>
public ConsumeOptions.Builder batchSize(int batchSize)
batchBytes(long)
constraint.
Less than 1 means default of when bytes are not specified. When bytes are specified, the batch messages size is set to prioritize the batch byte amount.
batchSize
- the batch size in messages.public ConsumeOptions.Builder batchBytes(long batchBytes)
When setting bytes to non-zero, the batch messages size is set to prioritize the batch byte size.
Also, 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.
batchBytes
- the batch size in bytes.Message.consumeByteCount()
public ConsumeOptions build()
build
in class BaseConsumeOptions.Builder<ConsumeOptions.Builder,ConsumeOptions>