spring-cloud / spring-cloud-sleuth

Distributed tracing for spring cloud
https://spring.io/projects/spring-cloud-sleuth
Apache License 2.0
1.77k stars 782 forks source link

JmsListener stops working if sleuth on the classpath #1414

Closed dome313 closed 5 years ago

dome313 commented 5 years ago

I have a simple rest controller which uses JmsTemplate to send a message

    @ResponseStatus(HttpStatus.OK)
    @GetMapping("/test")
    public void sendMessage() {
        System.out.println("Sending a test message");
        Map<String, String> map = new HashMap<>();
        map.put("hello", "world");
        jmsTemplate.convertAndSend("DEV.QUEUE.1", map);
    }

and then that message is consumed by JmsListener

    @JmsListener(destination = "DEV.QUEUE.1")
    public void receiveMessage(HashMap map) {
        System.out.println("Test message received...");
        System.out.println("Content received" + map);
    }

This code was tested with ActiveMQ and IBM MQ and it works fine. The things go wrong once I add spring-cloud-starter-sleuth to the classpath, after that JmsListner is not receiving the message anymore.

I created this mini project to demonstrate this https://github.com/dome313/jms-sleuth

Also, here it's state that sleuth supports Jms

Versions used: Spring boot: 2.1.6.RELEASE Spring cloud dependencies: Greenwich.RELEASE

marcingrzejszczak commented 5 years ago

Hi we already have greenwich.sr2 release can you please check if it works fine with that version? Thanks!

dome313 commented 5 years ago

Hi, it works fine with Greenwich.SR2. Thanks for your help. The way it is sorted on mvnrepository is to blame 😄 Screenshot_8

marcingrzejszczak commented 5 years ago

Great to hear that. BTW you can check https://spring.io/projects/spring-cloud#learn for the latest versions.