Class BatchSettings (2.19.8)

BatchSettings(
    max_bytes: int = 1000000, max_latency: float = 0.01, max_messages: int = 100
)

The settings for batch publishing the messages.

Attributes

NameDescription
max_bytes :noindex: int
The maximum total size of the messages to collect before automatically publishing the batch, including any byte size overhead of the publish request itself. The maximum value is bound by the server-side limit of 10_000_000 bytes. Defaults to 1 MB.
max_latency :noindex: float
The maximum number of seconds to wait for additional messages before automatically publishing the batch. Defaults to 10ms.
max_messages :noindex: int
The maximum number of messages to collect before automatically publishing the batch. Defaults to 100.

Methods

BatchSettings

BatchSettings(
    max_bytes: int = 1000000, max_latency: float = 0.01, max_messages: int = 100
)

Create new instance of BatchSettings(max_bytes, max_latency, max_messages)