@@ -72,7 +72,7 @@ The way that this works is that on the first message that you send, a new batch
7272is created automatically. For every subsequent message, if there is already a
7373valid batch that is still accepting messages, then that batch is used. When the
7474batch is created, it begins a countdown that publishes the batch once
75- sufficient time has elapsed (by default, this is 0.05 seconds).
75+ sufficient time has elapsed (by default, this is 0.01 seconds).
7676
7777If you need different batching settings, simply provide a
7878:class: `~.pubsub_v1.types.BatchSettings ` object when you instantiate the
@@ -84,11 +84,23 @@ If you need different batching settings, simply provide a
8484 from google.cloud.pubsub import types
8585
8686 client = pubsub.PublisherClient(
87- batch_settings = types.BatchSettings(max_messages = 500 ),
87+ batch_settings = types.BatchSettings(
88+ max_messages = 500 , # default 100
89+ max_bytes = 1024 , # default 1 MB
90+ max_latency = 1 # default .01 seconds
91+ ),
8892 )
8993
90- Pub/Sub accepts a maximum of 1,000 messages in a batch, and the size of a
91- batch can not exceed 10 megabytes.
94+ The `max_bytes ` argument is the maximum total size of the messages to collect
95+ before automatically publishing the batch, (in bytes) including any byte size
96+ overhead of the publish request itself. The maximum value is bound by the
97+ server-side limit of 10_000_000 bytes. The default value is 1 MB.
98+
99+ The `max_messages ` argument is the maximum number of messages to collect
100+ before automatically publishing the batch, the default value is 100 messages.
101+
102+ The `max_latency ` is the maximum number of seconds to wait for additional
103+ messages before automatically publishing the batch, the default is .01 seconds.
92104
93105
94106Futures
0 commit comments