I am using pykafka and have a producer that is producing asynchronously and using delivery_reports. I know the delivery reports must be read using the "get_delivery_report" method and I know it has to be called in same thread as the message that was produced. However, does get_delievery_report have to be called after each call to produce or can it be called a single time? Will get_delivery_report return all of the failed sends if more than one occurs. For example, say I send 100 messages asynchronously:
for x in xrange(100):
with topic.get_producer(delivery_reports=Try, sync=False) as producer:
producer.produce("Test Message")
msg, exc = producer.get_delivery_report()
or does it have to be:
for x in xrange(100):
with topic.get_producer(delivery_reports=Try, sync=False) as producer:
producer.produce("Test Message")
msg, exc = producer.get_delivery_report()
The first seems to run much faster than the second.