package com.example.demo; import org.springframework.jms.annotation.JmsListener; import org.springframework.messaging.handler.annotation.SendTo; import org.springframework.stereotype.Component; @Component public class Receiver { @JmsListener(destination = "testjms", containerFactory = "myFactory") @SendTo("testjms2Reply") public TestMsg receiveMessage(TestMsg msg) { System.out.println("Received <" + msg + ">"); msg.setBody("This is Jms Reply"); return msg; } }