Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing messages in consumer #91

Open
psamim opened this issue Jun 19, 2015 · 5 comments
Open

Missing messages in consumer #91

psamim opened this issue Jun 19, 2015 · 5 comments

Comments

@psamim
Copy link

psamim commented Jun 19, 2015

Hi,
I have a simple consumer script exactly the same as the one in the readme. I put numbers from 1 to 5 into a topic using a producer. I can consume and see these numbers from 1 to 5 using the kafka-console-consumer.sh, but using poseidon I receive the messages like below.

1
3
5

Any suggestions?

@damien
Copy link

damien commented Jun 24, 2015

Do you have multiple Kafka brokers/partitions? Could be you're just consuming messages from a single partition.

@psamim
Copy link
Author

psamim commented Jun 25, 2015

@damien Thanks for the response.

I did not set a partitioner for the producer so it seems that it is publishing messages to more than one partition. Can I have a consumer to consume all messages from a topic regardless of the partition? Or at least a way to know how many partitions are there for a topic.

Thanks

@damien
Copy link

damien commented Jun 25, 2015

Unfortunately, consuming messages from Kafka is quite a bit more complicated than publishing messages to Kafka. I'm in the process of figuring out a similar problem myself and the best ruby based consumer library I've been able to find for the problem is poseidon_cluster.

Setting that up and pointing it at your brokers should ensure you get all the messages you're looking for; otherwise you probably really are seeing a bug in poseidon itself.

@psamim
Copy link
Author

psamim commented Jun 26, 2015

I did a workaround which I think is wrong in general. I set the partitioner so that all messages are published to one partition. Then I create a partition consumer for that partition.

@damien
Copy link

damien commented Jun 26, 2015

That does seem to verify that you were only listening to one of multiple partitions. Definitely check out poseidon_cluster; your workaround may fix your problem but you'll be giving up a lot of Kafka's guarantees around persistence/availability if you're running off of a single partition.

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

No branches or pull requests

2 participants