1
votes

I want to use JMS Queues and Topics in my java Spring boot project. So for Topics I must use this one in application.properties spring.jms.pub-sub-domain = true. Now in the same project I want to receive queues messages too, buy ActiveMQ dont see any consumer for my queue... How can I make it works? Sample of my JmsListener for message send from ActiveMq localhost:8161

@JmsListener(destination = "FROMACTIVEMQ")
   public void getMessageFromActiveMq(TextMessage txt){
        logger.info(txt);
    }

What I am doing wrong? When I am using sendAndReceive method from JmsTemplate everything is going right...

1
You need separate listeners for queue and topic.duffymo
@duffymo I have, separate listeners in separate atComponent class, it still doesnt work...amkz

1 Answers

1
votes

Just define two DefaultJmsListenerContainerFactory - one for queue and one for topic - http://docs.spring.io/spring/docs/current/spring-framework-reference/html/jms.html 30.6.1 and pass it to @JmsListener(containerFactory = ""..)