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

Why do partition and timestamp default to 0 and 11 in producer record? #56

Closed
fmjrey opened this issue Dec 12, 2019 · 2 comments
Closed

Comments

@fmjrey
Copy link
Contributor

fmjrey commented Dec 12, 2019

See

(.send producer (->record {:key k :value v :topic topic :headers headers :partition 0 :timestamp 11})))

Timestamp defaulting to 11 and not 0 as specified by docstring seems weird.
More importantly, why do we need such defaults? They override Kafka API behavior with regards to default values, and they make (send! [this topic k v]) and (send! [this topic k v headers]) behave inconsistently (the first does not override Kafka API behavior, the second does).

Best is to not define any default values and let library clients handle them when needed.

@pyr pyr closed this as completed in 876451e Jan 6, 2020
@pyr
Copy link
Owner

pyr commented Jan 6, 2020

Hi @fmjrey ,

Happy new year and thanks for the report!

@fmjrey
Copy link
Contributor Author

fmjrey commented Jan 19, 2020

Hi @pyr, best wishes to you too!
Thanks for correcting this, I had little time when I filed this issue and could have provided a PR.
Nevertheless I just submitted a larger PR that also completes your fix by removing the no longer necessary associated comment:
bd07134#diff-5b6773780a4aa4b34911da7bc0b98b21L570

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