在 Jboss 7(以及 6)中,您捆绑了 HornetQ 服务器。在 Jboss 6 中,它位于 deploy\hornetq.sar。如果你想添加目的地,你可以在 hornetq-jms.xml 文件中指定它:
<topic name="myTopic">
<entry name="/topic/myTopic"/>
</topic>
<queue name="myQueue">
<entry name="/queue/myQueue"/>
</queue>
Run Code Online (Sandbox Code Playgroud)
在 Jboss 7 中,它如下所示:
<subsystem xmlns="urn:jboss:domain:messaging:1.1">
<hornetq-server>
<jms-destinations>
<jms-queue name="myQueue">
<entry name="queue/myqueue"/>
</jms-queue>
<jms-topic name="myTopic">
<entry name="topic/mytopic"/>
</jms-topic>
</jms-destinations>
</hornetq-server>
</subsystem>
Run Code Online (Sandbox Code Playgroud)
您可以在 HornetQ 文档中找到更多信息
最后我得到了使用 Jboss 6.x 的示例 jms 应用程序的链接。有两种方法可以在jboss中配置jms队列 1.在jboss/server/default/deploy/hornetq/hornetq.jms.xm中添加消息队列详细信息
<queue name="myQueue">
<entry name="/queue/MyQueue"/>
</queue>
Run Code Online (Sandbox Code Playgroud)
2.在工作区中创建xml文件并添加消息队列详细信息
<?xml version="1.0" encoding="UTF-8"?>
<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="urn:hornetq"
xsi:schemaLocation="urn:hornetq /schema/hornetq-jms.xsd" >
<queue name="MyQueue2" >
<entry name="/queue/MyQueue" />
</queue>
</configuration>
Run Code Online (Sandbox Code Playgroud)
将此文件保存在工作区的 META-INF 文件夹下。
请参阅此示例应用程序。
本例包括1.如何使用hornetq在jboss中配置jms。2.发送消息到jms消息队列 3.显示来自jboss服务器的消息
| 归档时间: |
|
| 查看次数: |
12329 次 |
| 最近记录: |