有没有办法在Kafka-Python消费者API中指定隔离级别?

Is there a way to specify the isolation level in Kafka-Python consumer API?

我正在尝试使用 Kafka-Python 编写一个消费者,以确保 exactly once 语义。分区中的消息是使用事务感知生产者生成的。我从 Kafka 文档中读到我应该将 isolation_level 指定为 read_committed 以便它只读取提交的消息。问题是我在 Python 客户端的文档中没有看到关于如何指定此 isolation_level 的任何地方。关于如何让我的消费者只阅读提交的消息有什么想法吗?

预期结果:只获取事务提交消息 实际结果:消费者甚至阅读看起来像这样的中止消息

ConsumerRecord(topic='tweets', partition=0, offset=504, timestamp=1557007360598, timestamp_type=0, key=b'\x00\x00\x00\x01', value='"\u0000\u0000\u0000\u0000\u0000\u0000"', checksum=None, serialized_key_size=4, serialized_value_size=6)

根据这个issue, isolation.level=read_committed is not supported from kafka-python还没有。