Skip to content

Conversation

@GurtejSohi
Copy link
Contributor

Description

The send method in our KafkaEventProducer library calls the send method of Apache's KafkaProducer which returns a Future but our library ignores it. As the documentation says, "The send is asynchronous and this method will return immediately once the record has been stored in the buffer of records waiting to be sent." Calling send() does NOT mean the record is already written to Kafka. If the client wants to check/ensure that the record was successfully written to Kafka, the client should check the Future returned by Apache KakaProducer's send method or provide a callback to the send method. But our library doesn't provide any of these capabilities. So, there is no way for the client of our library to know if there were any errors while writing to Kafka.

To address this shortcoming, I've added send method which accepts a callback.

@GurtejSohi GurtejSohi requested a review from a team as a code owner December 29, 2025 16:43
@github-actions
Copy link

Test Results

0 tests  ±0   0 ✅ ±0   0s ⏱️ ±0s
0 suites ±0   0 💤 ±0 
0 files   ±0   0 ❌ ±0 

Results for commit 020cd6f. ± Comparison against base commit 76a8dfa.

@GurtejSohi GurtejSohi merged commit 7c77c54 into main Dec 30, 2025
7 checks passed
@GurtejSohi GurtejSohi deleted the add-callback-support-in-send-method-of-event-producer branch December 30, 2025 04:36
@codecov
Copy link

codecov bot commented Dec 30, 2025

Codecov Report

❌ Patch coverage is 0% with 32 lines in your changes missing coverage. Please review.
✅ Project coverage is 0.00%. Comparing base (76a8dfa) to head (020cd6f).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...race/core/eventstore/kafka/KafkaEventProducer.java 0.00% 21 Missing ⚠️
...ava/org/hypertrace/core/eventstore/SendResult.java 0.00% 11 Missing ⚠️
Additional details and impacted files
@@          Coverage Diff          @@
##            main     #16   +/-   ##
=====================================
  Coverage   0.00%   0.00%           
=====================================
  Files          9      10    +1     
  Lines        187     219   +32     
  Branches       9      11    +2     
=====================================
- Misses       187     219   +32     
Flag Coverage Δ
unit 0.00% <0.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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

Successfully merging this pull request may close these issues.

3 participants