Reputation: 127
I have a JMSTemplate jmsT. To test it out, my only two lines of code are:
jmsT.convertAndSend("Location", "Message");
jmsT.receiveAndConvert("Location");
The code stalls at receiveAndConvert, waiting forever to receive a message as if it doesn't exist, despite that being exactly what the previous line creates.
Upvotes: 0
Views: 286
Reputation: 174564
If you are using an embedded ActiveMQ, you must use a CachingConnectionFactory
. Otherwise the embedded broker will go away between the two calls.
DEBUG logging is always your friend.
Upvotes: 1