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

Update record timestamp in MockProducer #7396

Open
wants to merge 2 commits into
base: trunk
Choose a base branch
from

Conversation

gowthamgutha
Copy link

The timestamp in the callback is returning -1. It should rather return the timestamp in the ProducerRecord object if available or return NO_TIMESTAMP if not available.

More detailed description of your change,
if necessary. The PR title and PR message become
the squashed commit message, so use a separate
comment to ping reviewers.

Summary of testing strategy (including rationale)
for the feature or bug fix. Unit and/or integration
tests are expected for any behaviour change and
system tests should be considered for larger changes.

Committer Checklist (excluded from commit message)

  • Verify design and implementation
  • Verify test coverage and CI build status
  • Verify documentation (including upgrade notes)

The timestamp in the callback is returning -1. It should rather return the timestamp in the ProducerRecord object if available or return NO_TIMESTAMP if not available.
@gowthamgutha gowthamgutha changed the title Update record timestamp Update record timestamp in MockProducer Sep 26, 2019
Copy link
Contributor

@bbejeck bbejeck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @gowthamgutha this change makes sense to me.
However, the ProducerRecord#timestamp field is a Long object and the check record.timestamp() == 0 is causing a NullPointerException in the MockProducerTest.
Maybe you can expand the check to something like (record.timestamp() == null || record.timestamp() == 0) ?

@gowthamgutha
Copy link
Author

Thanks, @gowthamgutha this change makes sense to me.
However, the ProducerRecord#timestamp field is a Long object and the check record.timestamp() == 0 is causing a NullPointerException in the MockProducerTest.
Maybe you can expand the check to something like (record.timestamp() == null || record.timestamp() == 0) ?

Thanks for the reply. I updated the PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants