Skip to content

[KafkaIO] Remove obsolete ConsumerSpEL and ProducerSpEL reflection shims - #40839

Merged
Abacn merged 1 commit into
apache:masterfrom
sjvanrossum:kafkaio-remove-spel
Oct 27, 2026
Merged

Abacn merged 1 commit into
apache:masterfrom
sjvanrossum:kafkaio-remove-spel

Conversation

@sjvanrossum

Copy link
Copy Markdown
Contributor

Removes the ConsumerSpEL and ProducerSpEL helpers which are no longer of any use since upgrading the minimum supported version of Kafka to 3.9.2.

@github-actions github-actions Bot added java io kafka size/m M: 50-249 lines changed labels Oct 27, 2026

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

📋 Review Summary

This PR cleanly removes the obsolete ConsumerSpEL and ProducerSpEL reflection shims in KafkaIO, replacing reflective calls with direct invocations against the modern kafka-clients API. The refactoring preserves existing exception handling and transaction semantics while simplifying record deserialization, header coding, and EOS sink management.

🔍 General Feedback

  • Direct exception handling for ProducerFencedException, OutOfOrderSequenceException, and AuthorizationException in KafkaExactlyOnceSink accurately preserves the prior behavior of bypassing abortTransaction() and closing the producer in the outer handler.
  • Moving offsetForTime to KafkaIOUtils and using RecordHeaders directly in KafkaRecordCoder and ProducerRecordCoder eliminates unnecessary reflection and temporary ConsumerRecord allocations.
  • No functional bugs or regressions identified.

💡 Tip: Comment /gemini review on this pull request to trigger a new Gemini code review.

@github-actions

Copy link
Copy Markdown
Contributor

Assigning reviewers:

R: @damccorm for label java.
Backup reviewer: chamikaramj (if the main reviewer is unresponsive, you can escalate to them by tagging their username)

Note: If you would like to opt out of this review, comment assign to next reviewer.

Available commands:

  • stop reviewer notifications - opt out of the automated review tooling
  • remind me after tests pass - tag the comment author after tests pass
  • waiting on author - shift the attention set back to the author (any comment or push by the author will return the attention set to the reviewers)

The PR bot will only process comments in the main thread (not review comments).

@Abacn Abacn left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks!

@Abacn
Abacn merged commit 0b90e18 into apache:master Oct 27, 2026
18 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