Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/324.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 如何在JBoss6中配置JMS?_Java_Jms_Jboss6.x - Fatal编程技术网

Java 如何在JBoss6中配置JMS?

Java 如何在JBoss6中配置JMS?,java,jms,jboss6.x,Java,Jms,Jboss6.x,我是JMS(java消息服务)的新手。我想使用JBoss6运行示例JMS应用程序 我已经厌倦了搜索谷歌,并且喜欢上了。这些链接是参考JBoss7的 1.如何在jboss 6中配置JMS 2.Jboss7是否有内置的JMS?还是需要手动配置 3.使用Jboss 6的示例应用程序?在Jboss 7(以及6)中,您已经绑定了HornetQ服务器。 在Jboss 6中,它位于deploy\hornetq.sar中。如果要添加目的地,可以在hornetq-jms.xml文件中指定: <topic n

我是JMS(java消息服务)的新手。我想使用JBoss6运行示例JMS应用程序

我已经厌倦了搜索谷歌,并且喜欢上了。这些链接是参考JBoss7的

1.如何在jboss 6中配置JMS

2.Jboss7是否有内置的JMS?还是需要手动配置

3.使用Jboss 6的示例应用程序?

在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>

在JBoss7中,它如下所示:

<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>


您可以在HornetQ文档中找到更多信息,最后我使用Jboss 6.x获得了示例jms应用程序的链接。 有两种方法可以在jboss中配置jms队列 1.在jboss/server/default/deploy/hornetq/hornetq.jms.xm中添加消息队列详细信息

<queue name="myQueue">
  <entry name="/queue/MyQueue"/>
</queue>

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>

在工作区的META-INF文件夹下维护此文件

参考此示例

在本例中,包括 1.如何使用hornetq在jboss中配置jms。 2.向jms消息队列发送消息
3.显示来自jboss服务器的消息

此外,您还可以输入自己的xml文件名,如
mysettings hornetq jms.xml
。将其放入
jboss6>deploy
文件夹中的
hornetq
文件夹中

当命名xml时,请使用
-hornetq jms.xml
(您的名字在前面)



谢谢Jakub。我已经配置了xml文件。之后我还能做什么?你能再解释一下吗?谢谢。我不知道你是否完整地阅读了问题。我是jms队列的新手。所以我期待jms配置和示例应用程序的工作原理。这里与@Jakub K answer有什么不同?
<configuration xmlns="urn:hornetq"
            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
            xsi:schemaLocation="urn:hornetq /schema/hornetq-jms.xsd">

   <queue name="testQueue">
      <entry name="/queue/myQueue"/>
   </queue>

</configuration>