producer.flush()
时它可以工作,但是根据kafka confluent issue却性能不佳,但是如建议的那样,我使用producer.poll(0)
但不会向主题发送任何消息,是否需要任何配置,或者我在这里缺少任何内容?self.producer.produce(topic.value, data.encode('utf-8'), callback=self.delivery_report)
self.producer.poll(0) # -> doesn't work
self.producer.flush() # -> works
当我使用producer.flush()时,它可以工作,但根据卡夫卡融合问题,性能却很差,但是如建议的那样,我使用producer.poll(0),但不会对主题产生任何消息,是否有任何配置...
poll()
不能使生产者同步,只是调用事件并触发您注册的任何callback()
。