alm0ra / mockafka-py

Mockafka-py is a Python library designed for in-memory mocking of Kafka.[aiokafka - confluence-kafka-python]
https://mockafka-py.readthedocs.io
MIT License
40 stars 10 forks source link

Message class incompatible with aiokafka's ConsumerRecord #109

Closed PeterJCLaw closed 2 weeks ago

PeterJCLaw commented 2 weeks ago

The Message class provided by this project and returned from e.g: FakeAIOKafkaConsumer.getone appears to be incompatible with the ConsumerRecord class provided by aiokafka.

Is this expected? Perhaps instead the structs from the mocked libraries could be used directly?

PeterJCLaw commented 2 weeks ago

Assuming that this isn't expected, I think we could adapt this in the FakeAIOKafkaConsumer class -- converting from the Message type to ConsumerRecord. What might make that interesting is that Message indicates that almost all of its fields are optional, whereas ConsumerRecord requires almost all fields to be present.