@@ -106,7 +106,16 @@ class KafkaProducer(object):
106
106
defaults to be suitable. If the values are set to something
107
107
incompatible with the idempotent producer, a KafkaConfigurationError
108
108
will be raised.
109
-
109
+ delivery_timeout_ms (float): An upper bound on the time to report success
110
+ or failure after producer.send() returns. This limits the total time
111
+ that a record will be delayed prior to sending, the time to await
112
+ acknowledgement from the broker (if expected), and the time allowed
113
+ for retriable send failures. The producer may report failure to send
114
+ a record earlier than this config if either an unrecoverable error is
115
+ encountered, the retries have been exhausted, or the record is added
116
+ to a batch which reached an earlier delivery expiration deadline.
117
+ The value of this config should be greater than or equal to the
118
+ sum of (request_timeout_ms + linger_ms). Default: 120000.
110
119
acks (0, 1, 'all'): The number of acknowledgments the producer requires
111
120
the leader to have received before considering a request complete.
112
121
This controls the durability of records that are sent. The
@@ -142,8 +151,12 @@ class KafkaProducer(object):
142
151
potentially change the ordering of records because if two batches
143
152
are sent to a single partition, and the first fails and is retried
144
153
but the second succeeds, then the records in the second batch may
145
- appear first.
146
- Default: 0.
154
+ appear first. Note additionally that produce requests will be
155
+ failed before the number of retries has been exhausted if the timeout
156
+ configured by delivery_timeout_ms expires first before successful
157
+ acknowledgement. Users should generally prefer to leave this config
158
+ unset and instead use delivery_timeout_ms to control retry behavior.
159
+ Default: 2147483647 (java max int).
147
160
batch_size (int): Requests sent to brokers will contain multiple
148
161
batches, one for each partition with data available to be sent.
149
162
A small batch size will make batching less common and may reduce
@@ -320,10 +333,11 @@ class KafkaProducer(object):
320
333
'enable_idempotence' : False ,
321
334
'transactional_id' : None ,
322
335
'transaction_timeout_ms' : 60000 ,
336
+ 'delivery_timeout_ms' : 120000 ,
323
337
'acks' : 1 ,
324
338
'bootstrap_topics_filter' : set (),
325
339
'compression_type' : None ,
326
- 'retries' : 0 ,
340
+ 'retries' : 2147483647 ,
327
341
'batch_size' : 16384 ,
328
342
'linger_ms' : 0 ,
329
343
'partitioner' : DefaultPartitioner (),
0 commit comments