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

Add Error Handling to Kafka IO #29546

Merged
merged 105 commits into from
Dec 7, 2023

Conversation

johnjcasey
Copy link
Contributor

@johnjcasey johnjcasey commented Nov 28, 2023

Add .withBadRecordHandler() functionality to both KafkaIO.read() and .write()

This also adds usage to the Kafka streaming example

Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:

  • Mention the appropriate issue in your description (for example: addresses #123), if applicable. This will automatically add a link to the pull request in the issue. If you would like the issue to automatically close on merging the pull request, comment fixes #<ISSUE NUMBER> instead.
  • Update CHANGES.md with noteworthy changes.
  • If this contribution is large, please file an Apache Individual Contributor License Agreement.

See the Contributor Guide for more tips on how to make review process smoother.

To check the build health, please visit https://github.com/apache/beam/blob/master/.test-infra/BUILD_STATUS.md

GitHub Actions Tests Status (on master branch)

Build python source distribution and wheels
Python tests
Java tests
Go tests

See CI.md for more information about GitHub Actions CI or the workflows README to see a list of phrases to trigger workflows.

johnjcasey and others added 30 commits July 5, 2023 16:05
Create gradle task and github actions config for GCS using this.
…tests

Feature/automate performance tests
…tests

add destination for triggered tests
…tests

move env variables to correct location
…tests

try uploading against separate dataset
…tests

update branch checkout, try to view the failure log
…tests

update to use correct BigQuery instance
@johnjcasey johnjcasey changed the title Feature/kafka read dlq Add Error Handling to Kafka IO Nov 30, 2023
update error handler to be serializable to support using it as a member of an auto-value based PTransform
@johnjcasey johnjcasey marked this pull request as ready for review December 5, 2023 20:20
@johnjcasey johnjcasey requested a review from Abacn December 5, 2023 20:20
Copy link
Contributor

github-actions bot commented Dec 5, 2023

Checks are failing. Will not request review until checks are succeeding. If you'd like to override that behavior, comment assign set of reviewers

@@ -18,6 +18,7 @@
project.ext {
delimited="0.11.0.3"
undelimited="01103"
sdfCompatable=false
Copy link
Contributor

Choose a reason for hiding this comment

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

is "Compatable" a typo here?

@@ -739,6 +754,9 @@ abstract Builder<K, V> setValueDeserializerProvider(

abstract Builder<K, V> setCheckStopReadingFn(@Nullable CheckStopReadingFn checkStopReadingFn);

abstract Builder<K, V> setBadRecordErrorHandler(
@Nullable ErrorHandler<BadRecord, ?> badRecordErrorHandler);
Copy link
Contributor

Choose a reason for hiding this comment

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

When will we ever put null in this parameter?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We will never set it to be null. This is @nullable to indicate that the property may not be set, and that is valid

} catch (SerializationException e) {
// This exception should only occur during the key and value deserialization when
// creating the Kafka Record
badRecordRouter.route(
Copy link
Contributor

Choose a reason for hiding this comment

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

QQ: do we have timestamp in DLQ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We do not

Copy link
Contributor

@shunping shunping left a comment

Choose a reason for hiding this comment

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

Just a few comments and questions. Overall LGTM.

@johnjcasey
Copy link
Contributor Author

GCP IO Direct test is a flake, whitespace failure is due to files this PR doesn't touch

@johnjcasey johnjcasey merged commit 5d11c20 into apache:master Dec 7, 2023
32 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants