Description
In what version(s) of Spring Integration are you seeing this issue?
Since 6.4
Describe the bug
The ControlBusCommandRegistry
implements DestructionAwareBeanPostProcessor
but does not override requiresDestruction
, which defaults to true. As a result, beans that are not meant to be processed during the destroy lifecycle are being registered for the procedure (AbstractBeanFactory#registerDisposableBeanIfNecessary). We are receiving loads of SimpleThreadScope does not support destruction callbacks.Consider using RequestScope in a web environment.
logs.
To Reproduce
Run the tests in https://github.com/t-ondrej/control-bus-command-registry-bug repo
Expected behavior
The ControlBusCommandRegistry
implements requiresDestruction
with proper post processing eligibility check.