Skip to content

Detect default JmsListenerContainerFactory automatically [SPR-11706] #16328

@spring-projects-issues

Description

@spring-projects-issues

Stéphane Nicoll opened SPR-11706 and commented

@JmsListener has a containerFactory attribute used to refer to the JmsListenerContainerFactory to use. The default can be set explicitly either using the XML namespace

<jms:annotation-driven default-container-factory="myFactory"/>

or using java config

@Configuration
@EnableJms
public class AppConfig implements JmsListenerConfigurer {

    @Override
    public void configureJmsListeners(JmsListenerEndpointRegistrar registrar) {
        registrar.setDefaultContainerFactory(myFactory());
    }
}

If that's specified, the containerFactory attribute can be omitted and the default will be assumed in that case.

A large majority of applications are using a single JMS broker and most are just using the sample template to create the container (different concurrency level may be what they would really need to change and topic/queue switch). We could decide to auto-detect the default container factory to use (and still give the ability to specify it explicitly of course!).

Proposal: lookup by name with "jmsListenerContainerFactory"

Also, look at <tx:annotation-driven> for reference


Affects: 4.1 RC1

Referenced from: commits 4b0aba6

Metadata

Metadata

Assignees

Labels

in: messagingIssues in messaging modules (jms, messaging)type: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions