Skip to content

Conversation

sobychacko
Copy link
Contributor

  • Bump kafkaVersion from 4.0.0 to 4.1.0 in build.gradle

  • Remove broker properties no longer needed in embedded Kafka tests:

    • unstable.api.versions.enable=true
    • group.coordinator.rebalance.protocols=classic,share
  • Replace AcknowledgeType.ACCEPT with commitSync() in share consumer tests

  • Update SerializationIntegrationTests to use Plugin-based deserializer access

@sobychacko sobychacko added this to the 4.0.0-M5 milestone Sep 4, 2025
@sobychacko sobychacko added the type: dependency-upgrade Pull requests that update a dependency file label Sep 4, 2025
Copy link
Member

@artembilan artembilan left a comment

Choose a reason for hiding this comment

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

The change looks OK, but totally unclear what is going on.
Can we have answers, please, why do we have to do this changes?
And I then place that into the final commit message.

Thanks

@artembilan
Copy link
Member

BTW, I don't see any changes in the main code, so feels like it still would be compatible with Kafka 4.0.
You made changes only in the test, which might be expected due to some internal changes in the broker or client.

- Bump kafkaVersion from 4.0.0 to 4.1.0 in build.gradle
- Remove broker properties no longer needed in embedded Kafka tests:

  * unstable.api.versions.enable=true
  * group.coordinator.rebalance.protocols=classic,share

- Replace AcknowledgeType.ACCEPT with commitSync() in share consumer tests
    - Remove explicit acknowledge() calls in implicit mode tests since 4.1.0 client disallowed that
    - Leverage implicit acknowledgment where records are automatically treated as ACCEPT
    - Use commitSync() for explicit commit timing instead of relying on next poll() auto-commit
    - Maintains same test semantics while following Kafka 4.1 implicit mode best practices
- Update SerializationIntegrationTests to use Plugin-based deserializer access

- Update SerializationIntegrationTests to use Plugin-based deserializer access in 4.1.0 client
    - Replace direct deserializer access with plugin mechanism retrieval
    - Use KafkaTestUtils.getPropertyValue() to access valueDeserializerPlugin from consumer internals
    - Verify plugin returns expected delegating deserializer instance

Signed-off-by: Soby Chacko <[email protected]>
@sobychacko
Copy link
Contributor Author

@artembilan, It came down to the fact that in 4.1.0, they introduced an implicit/explicit mode of ack (or changed the semantics of it). In the implicit mode (the default one), you are not allowed to explicitly call acknowledge, rather only commit (which by default is done on the next poll). Since in the test, we are not polling in a loop, the explicit call to commit was necessary. I updated the commit message and added some comments.

In the serializer test, they removed the deserializer field in preference to a plugin mechanism.

I will update the commit message and the comments. Thanks!

@artembilan artembilan enabled auto-merge (squash) September 5, 2025 15:40
@artembilan artembilan merged commit daf396e into spring-projects:main Sep 5, 2025
3 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: dependency-upgrade Pull requests that update a dependency file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants