首页 > 解决方案 > Spring Boot 应用程序启动中的嵌入式 ActiveMQ 无法正常工作

问题描述

最近,我们正在尝试在我们的 Spring Boot 应用程序中使用 ActiveMQ。我们所做的只是添加了 ActiveMQ 依赖项,如下所示:

compile("org.springframework.boot:spring-boot-starter-activemq:2.0.4.RELEASE")

以及以下配置:

#Embedded ActiveMQ Configuration
activemq:
  broker-url: vm://localhost?broker.persistent=false
#Spring JMS Settings
jms:
  listener:
    auto-startup: true
    concurrency: 1
    retries: 4
    exponential-backoff: true
    backoff-multiplier: 5

问题是当我们尝试启动应用程序时,我们会遇到以下警告,这显然意味着 ActiveMQ 没有正确启动。

2018-10-01 11:53:36.778  WARN 112 --- [enerContainer-1] o.s.j.l.DefaultMessageListenerContainer  : Setup of JMS message listener invoker failed for destination 'salesforce-queue' - trying to recover. Cause: peer (vm://localhost#5) stopped.    

2018-10-01 11:53:36.778  WARN 112 --- [enerContainer-1] o.s.j.l.DefaultMessageListenerContainer  : Setup of JMS message listener invoker failed for destination 'ActiveMQ.DLQ' - trying to recover. Cause: peer (vm://localhost#7) stopped.

如果您分享您的想法,我将不胜感激。

标签: javaspring-bootactivemq

解决方案


推荐阅读