Skip to content

Replace deprecated commitRecord method to support Kafka 4.0 #159

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Adil9645
Copy link
Contributor

Description

This Pull Request updates the usage of the deprecated commitRecord method to the new method introduced in Kafka 4.0.

The method signature:
public void commitRecord(final SourceRecord record) throws InterruptedException

has been replaced with:
public void commitRecord(final SourceRecord record, final RecordMetadata metadata) throws InterruptedException

All usages of the old method have been updated accordingly. For example:
newConnectTask.commitRecord(kafkaMessage);

has been changed to:
newConnectTask.commitRecord(kafkaMessage, null);

This ensures compatibility with Kafka 4.0 while maintaining existing functionality.

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

none of these - no functional change should be observed

How Has This Been Tested?

existing tests verify no regressions

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

Signed-off-by: A S Adil Mohammad <Adil.Mohammad@ibm.com>
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.

1 participant