Skip to content

Conversation

@skonik
Copy link
Contributor

@skonik skonik commented Jun 28, 2024

This PR fixes problem with consume method.
consumed_messages.append(self.poll()) saved wrong number of messages.

2 produced messages were appearing as only 1 message on consumer side using consumer.consume.

# producing 2 messages
producer = FakeProducer()
producer.produce(topic="test", value=b"test", partition=5)
producer.produce(topic="test", value=b"test", partition=5)

consumer = FakeConsumer()
consumer.subscribe(["test"])
messages = consumer.consume(10)

print(messages)
# returns 1 message. Expected - 2
# [<mockafka.message.Message object at 0x10bc0b2d0>]

@alm0ra alm0ra merged commit 7c344b0 into alm0ra:main Jun 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants