In RabbitAnnotationDrivenConfiguration, some beans may be created but unused.
When spring.rabbitmq.listener.type is missing value or simple, both directRabbitListenerContainerFactoryConfigurer and simpleRabbitListenerContainerFactoryConfigurer are created but directRabbitListenerContainerFactoryConfigurer is unused.
When spring.rabbitmq.listener.type is direct, both directRabbitListenerContainerFactoryConfigurer and simpleRabbitListenerContainerFactoryConfigurer are created but simpleRabbitListenerContainerFactoryConfigurer is unused.
Comment From: wilkinsona
Thanks for noticing and reporting this. I think it makes sense to reduce the number of beans that are created but we should only do so in a new minor release. There's a small chance that someone may be relying on one of the beans that appears to be unused and we wouldn't want to break their application in a maintenance release.
Comment From: wilkinsona
I was mistaken above. The current arrangement is intentional:
I've also simplified the configurer auto-config as we want both of them to be present regardless of the container type (you are free to create as many containers as you want after all).
Given that it's only a single possibly unused bean in each case and that removing it may be a breaking change, I no longer think that we should do this. Thanks anyway for the suggestion.