Transaction name is always null when debug logging @Transactional`` @JmsListener
methods.
This chunk of code in AbstractPollingMessageListenerContainer
returns null forgetBeanName():
// 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
.
Comment From: jhoeller
As a side note, exposing the endpoint id also enables the listener container to use specific thread names based on that id, just like the bean name for a manually defined listener container is also showing up in the thread names (with the default task executor).