简体   繁体   English

无法配置 JMS 2.0、ActiveMQ 5.x 和 Karaf

[英]Not able to configure JMS 2.0, ActiveMQ 5.x, and Karaf

I have been trying to setup pax-jms with ActiveMQ in Apache karaf.我一直在尝试在 Apache karaf 中使用 ActiveMQ 设置 pax-jms。 Following are the respective versions, that I have installed:以下是我已安装的相应版本:

activemq-osgi: 5.15.3
OPS4J Pax JMS * : 1.0.3
Karaf: 4.2.0
JMS API: 2.0.1

These are the features that I had installed:这些是我安装的功能:

> feature:repo-add mvn:org.ops4j.pax.jms/pax-jms-features/1.0.3/xml/features 
> feature:install pax-jms-activemq pax-jms-config

I can see that my configurations are being picked up properly.我可以看到我的配置被正确提取。 Thus, executing the command jms:connectionfactories shows the connection that I had configured.因此,执行命令jms:connectionfactories显示我配置的连接。

Note: I followed https://ops4j1.jira.com/wiki/spaces/PAXJMS/pages/331350050/Configuration , believing that the steps would have been similar for ActiveMQ as well.注意:我遵循了https://ops4j1.jira.com/wiki/spaces/PAXJMS/pages/331350050/Configuration ,认为 ActiveMQ 的步骤也类似。

My configuration looks as follows:我的配置如下所示:

jms.url=tcp://localhost:61616
jms.username=system
jms.password=manager
type=activemq
osgi.jndi.service.name=jms/demo.consumer

For the time being, I just wanted to test whether or not I can query the ActiveMQ broker from Karaf.目前,我只是想测试是否可以从 Karaf 查询 ActiveMQ 代理。 Thus, I tried jms:info jms/demo.consumer .因此,我尝试了jms:info jms/demo.consumer But, I am consistently getting the following error message:但是,我一直收到以下错误消息:

Error executing command: JMS 2.0 is not supported by ActiveMQ

I have tried changing the versions, tried on fresh karaf instances as well.我尝试过更改版本,也尝试过新的 karaf 实例。 But, I had no luck so far.但是,到目前为止我没有运气。 Am I missing some fundamental steps here?我在这里错过了一些基本步骤吗?

The error message is accurate.错误信息是准确的。 ActiveMQ 5.x doesn't support JMS 2.0. ActiveMQ 5.x 不支持 JMS 2.0。 This isn't a configuration issue.这不是配置问题。 It's simply not implemented.它根本没有实施。 If you want JMS 2.0 support from an ActiveMQ broker then you should use ActiveMQ Artemis .如果您希望来自 ActiveMQ 代理的 JMS 2.0 支持,那么您应该使用ActiveMQ Artemis For what it's worth, the documentation you referenced is using ActiveMQ Artemis.就其价值而言, 您引用文档使用的是 ActiveMQ Artemis。

The pax-jms-activemq module support ActiveMQ 5.x. pax-jms-activemq 模块支持 ActiveMQ 5.x。 The command line tools may not work b/c it calls ConnectionFactory.createContext() instead of .createConnection().命令行工具可能无法工作 b/c 它调用 ConnectionFactory.createContext() 而不是 .createConnection()。 JMS v2.0 has a couple features that ActiveMQ 5.x does not support-- shared durable subscriptions, basically. JMS v2.0 有几个 ActiveMQ 5.x 不支持的特性——基本上是共享持久订阅。

As long as the code that gets the ConnectionFactory calls .createConnection() instead of .createContext() it'll work just fine with the JMS API 2.0 jars.只要获取 ConnectionFactory 的代码调用 .createConnection() 而不是 .createContext() ,它就可以与 JMS API 2.0 jars 一起工作。 Java code, camel-activemq, camel-jms, etc will all work fine. Java 代码、camel-activemq、camel-jms 等都可以正常工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM