Spring-cloud-sleuth: Jms listeners not running

Created on 28 Jan 2019  路  8Comments  路  Source: spring-cloud/spring-cloud-sleuth

Hi,

I'm using spring-cloud-sleuth (2.1.0.RELEASE) and in this version I think there is a mistake in this commit https://github.com/spring-cloud/spring-cloud-sleuth/commit/6bee9fcb3aaecb2b325fadf853ea9b38592f405a

The TracingJmsListenerEndpointRegistry is no longer defined as a bean, so this is causing that the listeners included in this registry are not starting.

I defined a jms listener using the annotation @JmsListener, and I checked that it registers to TracingJmsListenerEndpointRegistry not in JmsListenerEndpointRegistry, and the listener does not consume any messages. I defined the bean TracingJmsListenerEndpointRegistry as already was before this commit, and the listener consumes the messages.

Regards

bug

Most helpful comment

I have the same problem since migration to spring cloud sleuth 2.1.0.
A workaround is to disable this feature:

We instrument the JmsTemplate so that tracing headers get injected into the message. We also support @JmsListener annotated methods on the consumer side.

To block this feature, set spring.sleuth.messaging.jms.enabled to false

spring.sleuth.messaging.jms.enabled=false

All 8 comments

Can you provide a complete, minimal, verifiable sample that reproduces the problem rather than pasted code? It should be available as a GitHub (or similar) project or attached to this issue as a zip file.

Sorry, I'm working in a complex application so I'd have to create an example only for this. Before of create an example because it will take some time for me to create it, can you answer me this question, who is starting the listeners if they are registered in TracingJmsListenerEndpointRegistry? The method which starts the listeners is in JmsListenerEndpointRegistry (start) because of the implementation of the Lifecycle interface, so I understand that this method will be called if the registry is defined as a bean, and with the last commit there is only one registry in the context the generic JmsListenerEndpointRegistry which is not used by the JmsListenerEndpointRegistrar.

The EndpointRegistry bean should be there provided by Boot (at least that's what @snicoll says). Please provide the sample, without it it will be difficult to help you.

I have encountered the same problem, just add spring-boot-starter-activemq and spring-cloud-starter-sleuth to the pom file at the same time to reproduce the problem.
By the way, everything is fine in the 2.0.x version. According to the Spring Boot 2.1 Release Notes, ActiveMQ Pooling has some changes in the 2.1.x version.

I have the same problem since migration to spring cloud sleuth 2.1.0.
A workaround is to disable this feature:

We instrument the JmsTemplate so that tracing headers get injected into the message. We also support @JmsListener annotated methods on the consumer side.

To block this feature, set spring.sleuth.messaging.jms.enabled to false

spring.sleuth.messaging.jms.enabled=false

Same here. I extracted my issue here: https://github.com/molk/greenwhich-jms-issue

Apologies - I can see this issue is closed and is tagged with 2.1.1.RELEASE
My question is: Is there any ETA on that being available in maven central?

Was this page helpful?
0 / 5 - 0 ratings