将 ActiveMQ 嵌入 JBoss 7
我们曾经使用ActiveMQ 5.5作为JBoss 5中的嵌入式服务(通过ActiveMQ资源适配器),以便JMS代理始终在同一台本地主机上运行JVM 作为客户端应用程序本身。我们按照此说明进行配置 - http://activemq.apache.org /integrating-apache-activemq-with-jboss.html
现在我尝试对 JBoss 7 执行相同的操作,但找不到任何明确的指南如何执行此操作。
有人这样做过吗?您能给我指出将 ActiveMQ 集成到 JBoss 7 中的具体步骤指南吗?
谢谢。
We used to use ActiveMQ 5.5 as an embedded service in JBoss 5 (via ActiveMQ Resource Adapter), so that the JMS broker has been always running on the localhost on the the same JVM as the client application itself. We followed this instructions to configure it - http://activemq.apache.org/integrating-apache-activemq-with-jboss.html
Now I'm trying to do the same for JBoss 7, but cannot find any clear guide how to do it.
Have anybody done this yet? Can you point me to the guideline with the concrete steps for integrating ActiveMQ into JBoss 7?
Thank you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我必须升级到 ActiveMQ 5.6
I had to upgrade to ActiveMQ 5.6
可以在 Wildfly 的 JVM 内启动 JMS 代理,因此无需设置不同的 ActiveMQ 服务器。
我所做的只是更改standalone.xml中的传输协议
从:
tcp://localhost:61616?jms.rmIdFromConnectionId=true
到:
vm://localhost?broker.persistent=false
将持久性设置为false很重要以避免持久性配置。另外,还可以通过参数brokerConfig=xbean:activemq.xml来设置ActiveMQ配置文件
监视 JMS 队列
既然 ActiveMQ 控制台已关闭,您可能想知道如何检查队列。您可以通过连接到 Wildfly JVM 的 JMX 环境来完成此操作。
您有两个选择:
- 使用 ActiveMQ Web 控制台
-使用JConsole
要在Wildfly中启用ActiveMQ控制台,只需两个步骤:
在standalone.xml中设置JVM系统参数,以通知ActiveMQ控制台应用程序通过JMX进行连接。在扩展标签下添加以下 JVM 系统参数:
部署 ActiveMQ 控制台 war。这个war包含jboss-client.jar(在/lib下)。
ActiveMQ 应该在此 WildFly 上下文下运行
http://localhost:8080/activemq-web -console-5.11.1/
只需将 jar jboss-cli-client.jar 添加到其类路径即可使用 JConsole。我添加了 bat 文件以在 Windows 上运行 jconsole。只需设置JAVA_HOME和JBOSS_JAR即可。
设置 JAVA_HOME=
设置 JBOSS_JAR=
%JAVA_HOME%\bin\jconsole -J-Djava.class.path=%JAVA_HOME%\lib\tools.jar;%JAVA_HOME%\lib\jconsole.jar;%JBOSS_JAR%\jboss-cli- client.jar”
在 JConsole 中的新连接上,选择远程进程。将值设置为:
service:jmx:http-remoting-jmx://localhost:9990
用户名 : your_admin_username
密码 : your_admin_password
将出现几个选项卡
转到 MBeans 选项卡, org.apache.activeMQ 子树将出现在左侧
以供进一步参考 。参见:
http://javagoogleappspot.blogspot.be/2015/12 /embed-your-activemq-broker-within-your.html
It is possible to launch the JMS broker inside the JVM of Wildfly so no need to set up a different ActiveMQ server.
All I did is just change the transport protocol inside standalone.xml
From :
tcp://localhost:61616?jms.rmIdFromConnectionId=true
To :
vm://localhost?broker.persistent=false
It is important to set the persistence to false as to avoid persistence configuration. In addtion, one can also set the ActiveMQ configuration file with the parameter brokerConfig=xbean:activemq.xml
Monitoring the JMS queues
Now that the ActiveMQ console is down you probably wonder how can you check the queues. You can do it by connection to JMX environment of the Wildfly JVM.
You have two options :
-Use the ActiveMQ web console
-Use JConsole
To enable the ActiveMQ console in Wildfly, just two steps are needed:
Set the JVM system parameters in standalone.xml to inform the ActiveMQ console application to connect through JMX. Add the following JVM system parameters under the extensions tag:
Deploy the ActiveMQ console war. This war contains the jboss-client.jar (under /lib).
The ActiveMQ should be running under this WildFly context
http://localhost:8080/activemq-web-console-5.11.1/
Just use JConsole by adding into its classpath the jar jboss-cli-client.jar. I have added bat file to run jconsole on Windows. Just set JAVA_HOME and JBOSS_JAR.
set JAVA_HOME=
set JBOSS_JAR=
%JAVA_HOME%\bin\jconsole -J-Djava.class.path=%JAVA_HOME%\lib\tools.jar;%JAVA_HOME%\lib\jconsole.jar;%JBOSS_JAR%\jboss-cli-client.jar"
On the new connection in JConsole, choose Remote process. Set value as :
service:jmx:http-remoting-jmx://localhost:9990
username : your_admin_username
password : your_admin_password
A few tabs will appear.
Go to MBeans tab, org.apache.activeMQ sub tree will appear on the left side.
For further reference, see :
http://javagoogleappspot.blogspot.be/2015/12/embed-your-activemq-broker-within-your.html