Skip to content

Add documents for the batching arguments when creating producer #205

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions pulsar/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -670,6 +670,20 @@ def create_producer(self, topic,

SNAPPY is supported since Pulsar 2.4. Consumers will need to be at least at that release in order to
be able to receive messages compressed with SNAPPY.
batching_enabled: bool, default=False
When automatic batching is enabled, multiple calls to `send` can result in a single batch to be sent to the
broker, leading to better throughput, especially when publishing small messages.
All messages in a batch will be published as a single batched message. The consumer will be delivered
individual messages in the batch in the same order they were enqueued.
batching_max_messages: int, default=1000
When you set this option to a value greater than 1, messages are queued until this threshold or
`batching_max_allowed_size_in_bytes` is reached or batch interval has elapsed.
batching_max_allowed_size_in_bytes: int, default=128*1024
When you set this option to a value greater than 1, messages are queued until this threshold or
`batching_max_messages` is reached or batch interval has elapsed.
batching_max_publish_delay_ms: int, default=10
The batch interval in milliseconds. Queued messages will be sent in batch after this interval even if both
the threshold of `batching_max_messages` and `batching_max_allowed_size_in_bytes` are not reached.
max_pending_messages: int, default=1000
Set the max size of the queue holding the messages pending to receive an acknowledgment from the broker.
max_pending_messages_across_partitions: int, default=50000
Expand Down