Skip to content

Commit 5ef6595

Browse files
committed
fixup set_producer_id_and_epoch from sender
1 parent ab28572 commit 5ef6595

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

kafka/producer/sender.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
from kafka import errors as Errors
1212
from kafka.metrics.measurable import AnonMeasurable
1313
from kafka.metrics.stats import Avg, Max, Rate
14+
from kafka.producer.transaction_manager import ProducerIdAndEpoch
1415
from kafka.protocol.init_producer_id import InitProducerIdRequest
1516
from kafka.protocol.produce import ProduceRequest
1617
from kafka.structs import TopicPartition
@@ -317,7 +318,7 @@ def _maybe_wait_for_producer_id(self):
317318
response = self._client.send_and_receive(node_id, request)
318319
error_type = Errors.for_code(response.error_code)
319320
if error_type is Errors.NoError:
320-
self._transaction_manager.set_producer_id_and_epoch(response.producer_id, response.producer_epoch)
321+
self._transaction_manager.set_producer_id_and_epoch(ProducerIdAndEpoch(response.producer_id, response.producer_epoch))
321322
elif getattr(error_type, 'retriable', False):
322323
log.debug("Retriable error from InitProducerId response: %s", error_type.__name__)
323324
if getattr(error_type, 'invalid_metadata', False):

0 commit comments

Comments
 (0)