-
Notifications
You must be signed in to change notification settings - Fork 3
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
Allow setting keys in outbox messages #1
Comments
Hi, @mgibowski. I agree we should support
Perhaps we could follow along and have |
Yes, that makes sense! |
I started #2 adding this feature. It will be a breaking change, but I'll try to make it smooth. |
So far looks great!
Yes, we plan to release code that uses Kafkaesque to production in middle November. 1.0 by that time would be awesome :) |
The problem
At the moment, published messages have always an empty key:
kafkaesque/lib/kafkaesque/clients/brod_client.ex
Line 42 in 2c43100
This prevents key-based retention via topic compaction:
https://developer.confluent.io/courses/architecture/compaction/#topic-compaction-key-based-retention
The solution
That would be a breaking change, but I think the
MyApp.Outbox.publish/2
function should accept three arguments and become:MyApp.Outbox.publish("topic", "key", %{hello: :kafka})
Similarly, the
Kafkaesque.publish/4
function would becomeKafkaesque.publish/5
and acceptkey
argument just before thepayload
.And the structure of
Kafkaesque.Message
schema would be extended with thekey
field.@v0idpwn What do you think?
The text was updated successfully, but these errors were encountered: