将 JMS 队列添加到 Jboss 7
我想尝试了解 JMS 的工作原理。我正在学习教程并创建了生产者/消费者 java 类,但不确定如何创建 JMS 队列。我下载了 jboss-as-web-7.0.2.Final,我相信它有 HornetQ。到目前为止我还没有找到任何地方,因为我只是不知道如何添加队列。
根据此文档 https://docs.jboss.org/author/display/AS7 /Messaging+configuration ,可以使用 add-jms-queue 命令添加队列。我尝试过,但它产生了一个错误。
[standalone@localhost:9999 /] add-jms-queue --name=sampleQueue --entries=queue/sampleQueue
The command is not available in the current context (e.g. required subsystems or connection to the controller might be unavailable).
我也找不到通过 GUI 上的管理控制台添加队列的选项。
有什么想法吗?
谢谢
I want to try and get an understanding of how JMS works. I am going through a tutorial and have created the Producer/Consumer java classes but not sure how to create the JMS queue. I downloaded jboss-as-web-7.0.2.Final which i believe has HornetQ. I have not got anywhere so far as i just cant figure out how to add a Queue.
According to this document https://docs.jboss.org/author/display/AS7/Messaging+configuration , a queue can be added by using the add-jms-queue command. I tried it but it generates an error.
[standalone@localhost:9999 /] add-jms-queue --name=sampleQueue --entries=queue/sampleQueue
The command is not available in the current context (e.g. required subsystems or connection to the controller might be unavailable).
I also cant find an option to add the queue via the admin console on the GUI.
Any ideas?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
如果您有 JBoss 7 Web(Java EE6 认证),它不包含 JMS 实现 (HornetQ),因为它尚未获得批准。 JBoss 7 Everything(未经 Java EE6 认证)包含 JMS 实现。
If you have JBoss 7 web (Java EE6 Certified), It doesn't contain JMS implementation (HornetQ) as it has not been approved yet. JBoss 7 Everything (NOT Java EE6 Certified) contains JMS implementation.
对于在使用 JBoss 7.1.x 时具有相同消息的其他人:
您应该在文件standalone/configuration/standalone.xml 中添加一个新的 JMS 子系统(
您应该使用以下命令:
jms-queue add --queue-address=MyQueue --entries=queue/MyQueue,java:/jms/myApp/MyQueue
编辑:
在 WildFly 上您可能还需要添加
For other people which have the same message while using JBoss 7.1.x:
You should add the in the file standalone/configuration/standalone.xml a new subsystem for JMS (<subsystem xmlns="urn:jboss:domain:messaging:1.1">). You can look into the standalone/configuration/standalone-full.xml for that subsystem or simple use the standalone-full.xml.
And you should use the following command:
jms-queue add --queue-address=MyQueue --entries=queue/MyQueue,java:/jms/myApp/MyQueue
EDIT:
On WildFly you need may be also to add
虽然 JMS 配置现在位于standalone-full.xml 中,但我们可以配置standalone.xml 来获得JMS 队列支持。您可以按照 在 JBOSS AS7 的 STANDALONE.XML 中配置 JMS 队列
。配置完成后,您可以使用standalone.xml 配置启动JBoss 服务器。
Although the JMS configurations are now in standalone-full.xml, we can configure standalone.xml to get JMS queue support. You can follow the steps mentioned in CONFIGURE A JMS QUEUE IN STANDALONE.XML OF JBOSS AS7
. After configuring this, you can start JBoss server with standalone.xml configurations.