Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/spring-boot/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java Active MQ标识ActiveMQ的队列地址_Java_Spring Boot_Jms_Activemq_Spring Messaging - Fatal编程技术网

Java Active MQ标识ActiveMQ的队列地址

Java Active MQ标识ActiveMQ的队列地址,java,spring-boot,jms,activemq,spring-messaging,Java,Spring Boot,Jms,Activemq,Spring Messaging,这是我用来接收消息的POJO类。我可以通过JCONSOLE在这里发送消息,但是,如果我有另一个应用程序需要将消息发送到此侦听器/队列,该怎么办?我该如何确定地址?这是通过spring引导自动配置的。我只指定了activemq jar @Component public class OrderItemListener{ @Autowired private final StoreService storeService; @JmsListener(destination

这是我用来接收消息的POJO类。我可以通过JCONSOLE在这里发送消息,但是,如果我有另一个应用程序需要将消息发送到此侦听器/队列,该怎么办?我该如何确定地址?这是通过spring引导自动配置的。我只指定了activemq jar

@Component
public class OrderItemListener{

    @Autowired
    private final StoreService storeService;

    @JmsListener(destination = "order.item.queue")
    public void receiveOrder(String message) {
        //processing
    }
}
如果这在不同的JVM中运行,则需要一个独立的代理,并设置
spring.activemq.broker-url=tcp://somehost:61616

@Autowired
private JmsTemplate template;

...


    this.template.convertAndSend("order.item.queue", "foo");