Spring整合ActiveMQ(消费者)
import org.springframework.jms.annotation.JmsListener;
import org.springframework.stereotype.Component;
import javax.jms.TextMessage;
@Component
public class PC{
@JmsListener(destination = "${mymq}")
public void rec(TextMessage textMessage) throws Exception{
System.out.println(textMessage.getText());
}
}