Loading
The batching section of aerospike-pubsub-outbound.yml
The batching
section corresponds to Pub/Sub's com.google.api.gax.batching.BatchingSettings API. By default, batching is turned on. When batching is turned on, requests from subscriber clients are queued. When any of the thresholds in the table below are reached, the queued requests are packaged together into a batch and set to Pub/Sub as a single RPC. When the response comes back, it is split apart into individual responses according to the individual input requests.
caution
It is possible to cause long periods of wait time if you do not configure batching properly.
Option | Required? | Default | Description |
---|---|---|---|
delay-threshold | No | 1 millisecond (T0.001S ) | Corresponds to the setting Delay Threshold. Counting from the time that the first message is queued, after this delay passes, then send the batch. Uses a format similar to the ISO-8601 format for durations. The format is PnDTnHnMn.nS , where
|
element-count-threshold | No | 1 | Corresponds to the setting Element Count Threshold. After this many messages are queued, send all of the messages in a single call, even if the delay threshold hasn't elapsed yet. |
flow-control | No | N/A | See "Controlling the flow of messages" below. |
request-byte-threshold | No | 1 | After the number of bytes in the batched request reaches this threshold, send all of the messages in a single call, even if neither the delay or message count thresholds have been exceeded yet. |
Controlling the flow of messages
You can use the optional flow-control
section to prevent batching from accumulating messages without limit, resulting eventually in an OutOfMemory exception.
Option | Required? | Description |
---|---|---|
limit-exceeded-behavior | No | Specifies what the connector should do if either of the specified limits is exceeded.
|
max-outstanding-element-count | No | Maximum number of outstanding elements to keep in memory before enforcing flow control. |
max-outstanding-request-bytes | No | Maximum number of outstanding bytes to keep in memory before enforcing flow control. |
Example
batching: # OPTIONAL. Settings conforming to com.google.api.gax.batching.BatchingSettings
element-count-threshold: 1 # OPTIONAL.
request-byte-threshold: 1 # OPTIONAL.
delay-threshold: P2D # OPTIONAL. ISO-8601 like duration format (PnDTnHnMn.nS).
flow-control: # OPTIONAL. Settings conforming to com.google.api.gax.batching.FlowControlSettings.
limit-exceeded-behavior: block # OPTIONAL. Options are [throw, block, ignore]
max-outstanding-element-count: 1 # OPTIONAL.
max-outstanding-request-bytes: 1 # OPTIONAL.