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

Avoid parsing internal Debezium messages [HZ-3863] #26027

Conversation

TomaszGaweda
Copy link
Contributor

@TomaszGaweda TomaszGaweda commented Nov 21, 2023

Adding e.g. heartbeat config adds messages with value schema's name io.debezium.connector.common.Heartbeat

It's also under __debezium* topics, so easy to filter out

Fixes #26005

Checklist:

  • Labels (Team:, Type:, Source:, Module:) and Milestone set
  • Add Add to Release Notes label if changes should be mentioned in release notes or Not Release Notes content if changes are not relevant for release notes
  • Request reviewers if possible
  • Send backports/forwardports if fix needs to be applied to past/future releases

@TomaszGaweda TomaszGaweda added this to the 5.4.0 milestone Nov 21, 2023
@@ -54,7 +54,8 @@ public ChangeRecordCdcSourceP(
@Nullable
@Override
protected ChangeRecord map(SourceRecord record) {
if (record == null) {
if (record == null || record.topic().startsWith("__debezium")) {
// internal Debezium messages about e.g. Heartbeat uses such topics
return null;
Copy link
Contributor

Choose a reason for hiding this comment

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

Another alternative could be

Struct sourceRecordValue = (Struct) sourceRecord.value();
String sourceSchemaName = sourceRecordValue.schema().name();
return sourceSchemaName.startsWith ("io.debezium")

Copy link
Contributor Author

Choose a reason for hiding this comment

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

True, it's the same as with value IMHO, so I left only scanning value. But good point :)

@TomaszGaweda TomaszGaweda merged commit 1b7bbd2 into hazelcast:master Nov 29, 2023
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Setting debezium heartbeat.interval.ms custom property causes processing to fail [HZ-3863]
2 participants