ActiveMQ 无法识别 Stomp:传输方案无法识别:[stomp+ssl]



我正在尝试在puppetmaster(开源木偶)上设置mcollective/activemq。我遇到了一个问题,ActiveMQ不识别Stomp协议。下面是我的/etc/activemq/instances-enabled/activemq/activemq.xml文件中的相关代码片段,它应该启用stomp+ssl:

<transportConnectors>
            <transportConnector name="openwire" uri="tcp://0.0.0.0:61616"/>
            <transportConnector name="stomp+ssl" uri="stomp+ssl://0.0.0.0:61614?needClientAuth=true&amp;transport.enabledProtocols=TLSv1,TLSv1.1,TLSv1.2"/>
</transportConnectors>

当我通过service activemq start启动ActiveMQ时,我注意到守护进程没有结束运行(我不认为它是一个进程)。然后我试着运行service activemq console activemq,看起来问题是它找不到stomp Transport方案。下面是我在输出中看到的第一个错误(错误在整个输出中持续存在):

ERROR |启动Apache失败ActiveMQ ([localhost,ID: myy-servers-hostname.example.com-4047-1475514312306-0:1], java.io.IOException: Transport无法在其中注册连接器JMX: java.io.IOException: Transport[stomp+ssl])

ActiveMQ可以很好地识别openwire。当只使用openwire+ssl,而不使用stomp+ssl时,ActiveMQ守护进程启动正常,没有错误。然而,当我尝试运行mco find时,我得到一个错误,因为似乎mco仍在尝试使用stomp+ssl(和ActiveMQ只启用了openwire+ssl):

error 2016/10/03 17:26:59: activemq. error。使用stomp+ SSL://mcollective@localhost:61614创建SSL会话失败:连接被拒绝-连接(2)为"localhost"端口61614

也许我需要调整我的mco配置使用开放电线而不是跺脚?我不确定配置将在哪里或什么文件中。不知道为什么它认不出stomp,但我想知道我有什么选择。是否有可能使用MCollective/ActiveMQ只使用openwire+ssl,或者如果我想使用mco,是否需要使用stomp ?我不认为这是端口问题,因为我相信服务器上的相关端口是开放的。

以下是我机器上安装的相关软件包/版本:

OS: Ubuntu 16.04 (xenial)
puppet: 4.7.0
ActiveMQ: 5.13.2
ruby-stomp: 1.3.5-1
MCollective (mco) version: 2.9.0

我在项目中嵌入ActiveMQ服务器时遇到了同样的问题。原来我需要在我的pom中添加以下依赖项。

    <dependency>
        <groupId>org.apache.activemq</groupId>
        <artifactId>activemq-stomp</artifactId>
        <version>5.15.0</version>
    </dependency>
    <dependency>
        <groupId>org.apache.activemq</groupId>
        <artifactId>activemq-kahadb-store</artifactId>
        <version>5.15.0</version>
    </dependency>

在你的情况下,我认为你需要得到这两个jar并将它们添加到你的ActiveMQ安装

在ubuntu 16+提供的activemq包中没有包含库stomp传输。我不知道为什么。您可以手动下载并放置在/usr/share/activemq/lib:

cd /usr/share/activemq/lib
# check your actviemq version before (apt-cache policy activemq) and use the relevant version of library.
wget https://repository.apache.org/content/repositories/releases/org/apache/activemq/activemq-stomp/5.13.5/activemq-stomp-5.13.5.jar
service activemq restart

最新更新