Skip to content

Expose @JmsListener endpoint id to annotation-derived listener container (for transaction definition name) #26683

Closed
@zerocode

Description

@zerocode

Transaction name is always null when debug logging @Transactional`` @JmsListener methods.

This chunk of code in AbstractPollingMessageListenerContainer returns null for getBeanName():

                                // Use bean name as default transaction name.
                                if (this.transactionDefinition.getName() == null) {
                                                String beanName = getBeanName();
                                                if (beanName != null) {
                                                                this.transactionDefinition.setName(beanName);
                                                }
                                }

It should be easy to support by setting the beanName from the endpoint passed into createListenerContainer(JmsListenerEndpoint endpoint) { ... } in AbstractJmsListenerContainerFactory.

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