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

Add Topic and Partition ID to Protocol.Fetch.Message #358

Closed
yogodoshi opened this issue Aug 15, 2019 · 1 comment
Closed

Add Topic and Partition ID to Protocol.Fetch.Message #358

yogodoshi opened this issue Aug 15, 2019 · 1 comment

Comments

@yogodoshi
Copy link

yogodoshi commented Aug 15, 2019

On the Message struct there is the offset field but not the topic or the partition ID. It would be very useful for me if them were there as well, here is why:

topic_name
|> retrieve_partitions_ids
|> create_streams(topic_name)
|> Flow.from_enumerables()
|> Flow.map(&prepare_for_partition/1)
|> Flow.partition(key: {:elem, 0}, window: periodic_window)
|> Flow.reduce(&accumulator_tuple/0, &save_kafka_message_to_ets/2)
(more Flow stuff)
|> Flow.on_trigger(&send_to_redshift/3)
|> Flow.run()

I have a Flow with a KafkaEx.stream for each partition and down the road, I don't really have a way to know from which partition each message is from, which prevents me from committing the offset.

I would think that if this information would be great to have in my scenario, it would probably also be useful to others as a Map-Reduce is probably frequently used with KafkaEx.stream 🤔

If you think this change makes sense let me know and I can try opening a PR implementing it :)

@yogodoshi yogodoshi changed the title Add Topic and Partition ID on Protocol.Fetch.Message Add Topic and Partition ID to Protocol.Fetch.Message Aug 15, 2019
@joshuawscott
Copy link
Member

Fixed in #360

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