Skip to content
This repository has been archived by the owner on Feb 21, 2024. It is now read-only.

allow modify RabbitListenerContainerFactory created by MultiRabbitAutoConfiguration #94

Open
kondratenko-jek opened this issue Mar 1, 2023 · 0 comments

Comments

@kondratenko-jek
Copy link

Hello
When I use multirabbit library I want to set errorHandler to SimpleRabbitListenerContainerFactory, but, as I can see in sources (MultiRabbitAutoConfiguration), there always creating SimpleRabbitListenerContainerFactory with ConnectionFactory and I can not modify that containerFactory in any way:

private SimpleRabbitListenerContainerFactory newContainerFactory(final ConnectionFactory connectionFactory) {
final SimpleRabbitListenerContainerFactory containerFactory = new SimpleRabbitListenerContainerFactory();
containerFactory.setConnectionFactory(connectionFactory);
return containerFactory;
}

Is it possible add some customizers or something like this, where I will be able to modify containerFactory ?

Other proposition is create an interface that will create RabbitListenerContainerFactory, input - ConnectionFactory and name from properties. And allow users to provide own implementation.

Example:

public interface RabbitListenerContainerFactoryCreator {
RabbitListenerContainerFactory<?> createRabbitListenerContainerFactory(ConnectionFactory connectionFactory, String key);
}

By default, if no user implementation, use old method - create SimpleRabbitListenerContainerFactory with only ConnectionFactory

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

1 participant