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

allow modify RabbitListenerContainerFactory created by MultiRabbitAutoConfiguration #94

@kondratenko-jek

Description

@kondratenko-jek

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions