Skip to content

Conversation

artembilan
Copy link
Member

Related to: #10345

  • Replace RetryTemplate from Spring Retry to RetryTemplate from Spring Core since Spring Retry is at its sunset.
    There is no deprecation for Spring Retry API usage since the idea is to remove Spring Retry dependency altogether for the upcoming major for all projects in the Spring portfolio

  • Introduce a KafkaInboundEndpoint.RetryContext as an AttributeAccessorSupport extension to track the number of retries for functional compatibility

Related to: spring-projects#10345

* Replace `RetryTemplate` from Spring Retry to `RetryTemplate` from Spring Core
since Spring Retry is at its sunset.
There is no deprecation for Spring Retry API usage since the idea is to remove
Spring Retry dependency altogether for the upcoming major for all projects in the Spring portfolio

* Introduce a `KafkaInboundEndpoint.RetryContext` as an `AttributeAccessorSupport`
extension to track the number of retries for functional compatibility
Copy link
Contributor

@cppwfs cppwfs left a comment

Choose a reason for hiding this comment

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

LGTM just some nitpicks as usual ;-)

* @param consumer the consumer.
* @param runnable the runnable.
*/
default void doWithRetry(RetryTemplate template, @Nullable RecoveryCallback<?> callback, ConsumerRecord<?, ?> record,
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't doWithRetry be @Nullable since it can return a null?

Copy link
Member Author

Choose a reason for hiding this comment

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

The return does not apply to the logic of Kafka Inbound Endpoints.
Therefore void here and just swallowing null return from the RetryTemplate.execute().

* Remove redundant now `// NOSONAR` comments from the `KafkaInboundGateway` & `KafkaMessageDrivenChannelAdapter`
* Fix missed in the previous commit `KafkaMessageDrivenChannelAdapter.setAttributesIfNecessary()`
* Change the logic around `KafkaMessageDrivenChannelAdapter.sendMessageIfAny()` to the `doSendMessage()`
to reflect its reality
* Change conversion failure `debug` logic to `warn`
@artembilan artembilan requested a review from cppwfs September 5, 2025 18:41
Copy link
Contributor

@cppwfs cppwfs left a comment

Choose a reason for hiding this comment

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

LGTM.

@cppwfs cppwfs merged commit e1e1f29 into spring-projects:main Sep 5, 2025
3 checks passed
@snicoll
Copy link
Member

snicoll commented Sep 13, 2025

Good stuff 👍👍

@artembilan
Copy link
Member Author

Thank you for feedback, @snicoll !
FYI: #10401

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.

3 participants