confluent-kafka-python: Consumer.commit() 没有参数

confluent-kafka-python: Consumer.commit() with no parameters

我注意到传递调用 Consumer.commit(msg=None) 是一个有效的案例。至少它是在图书馆的代码中单独处理的。我想知道这样做与使用 "msg" 参数的最后读取消息调用 Consumer.commit 之间有什么区别。

看起来它做了几乎相同的事情,但是为什么参数总是在 examples/integration_test.py 的所有测试中显式传递?

https://github.com/confluentinc/confluent-kafka-python/issues/277

Magnus Edenhill 的回答:

The argument-less commit() will commit all uncommitted offsets for the current assignment.

The Python integration tests are primarily to verify the APIs with a live broker environment, the actual kafka client tests reside in librdkafka's build tree and are much more detailed. librdkafka (using this Python client) also runs the full standard Apache Kafka client system test suite in a nightly job.