SimpleMessageListenerContainer 中的退避使用 class
Backoff usage in SimpleMessageListenerContainer class
我可以理解 org.springframework.util.backoff
存在于简单的用例中并用于核心 spring 模块。 (对比使用 spring-retry
)。
但我的问题是,为什么 spring-amqp
在 SimpleMessageListenerContainer
的 handleStartupFailure()
中使用它而不是 spring-retry
,因为 spring-retry
已经是一个依赖项。
最初,侦听器容器没有退避机制,只有 recoveryInterval
。
添加退避后,我们不需要 spring-retry 提供的额外功能(异常分类、状态重试等),因此使用 Spring 实用程序似乎更简单。
你担心什么?您需要的当前机制没有提供什么?
我可以理解 org.springframework.util.backoff
存在于简单的用例中并用于核心 spring 模块。 (对比使用 spring-retry
)。
但我的问题是,为什么 spring-amqp
在 SimpleMessageListenerContainer
的 handleStartupFailure()
中使用它而不是 spring-retry
,因为 spring-retry
已经是一个依赖项。
最初,侦听器容器没有退避机制,只有 recoveryInterval
。
添加退避后,我们不需要 spring-retry 提供的额外功能(异常分类、状态重试等),因此使用 Spring 实用程序似乎更简单。
你担心什么?您需要的当前机制没有提供什么?