Skip to content

Adapt RabbitRetryTemplateCustomizer now that Spring AMQP no longer relies on Spring Retry #47122

@snicoll

Description

@snicoll

Looking at the latest state of affairs in Spring AMQP, things are a bit out of sync:

  • The server-side (interceptors for @RetryTopicListener)requires a RetryPolicy to be set, not a RetryTemplate. The reasoning behind that is that it doesn't use RetryTemplate at all, only what the retry policy provides to compute back off values.
  • The client-side ( RabbitTemplate) still offers a callback to set the retry template. This allows to not only set the retry policy but also any RetryListener that might be required. Custom listeners support was the root cause for RabbitTemplateCustomizer to be added (Add RabbitTemplateCustomizer to allow customization of RabbitTemplates #34050)

RabbitRetryTemplateCustomizer looks wrong now as it is no longer required by the server-side. And this callback only allowed to replace BackOffPolicy & RetryPolicy (configured by properties by default) by new instance that doesn't know about existing settings.

This is required to update to the latest milestone, see #46999.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions