Skip to content

ControlBusCommandRegistry registers beans for destruction lifecycle unintentionally #9890

Closed
@t-ondrej

Description

@t-ondrej

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions