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

Allow the user to set the key of the SourceRecord explicitly #20

Closed
oscerd opened this issue Dec 9, 2019 · 0 comments
Closed

Allow the user to set the key of the SourceRecord explicitly #20

oscerd opened this issue Dec 9, 2019 · 0 comments
Assignees

Comments

@oscerd
Copy link
Contributor

oscerd commented Dec 9, 2019

Currently, when the messages being polled, via this method:

SourceRecord record = new SourceRecord(sourcePartition, sourceOffset, topic, Schema.BYTES_SCHEMA, exchange.getMessage().getBody());

We don't set the Key of the record in the SourceRecord constructor which could be dangerous to send these data downstream non-keyed, therefore to tackle this, I'd suggest to all the user to set the Key explicitly, let's see a key of the exchange is available as a header, the user will just supply the name of the header in order to key the record with.
By default, I'd suggest to key the message by the messageId in case the user didn't set any configuration for the keys

author @omarsmak

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