문제

I newbie to JMS(java Messaging service). I want to run sample JMS application using jboss 6.

I have tired searching google and got like this. Those link are refer jboss 7.

1.How to configure JMS in jboss 6?

2.Is there Jboss7 have in built-in JMS? or need configure manually?

3.sample Application using Jboss 6?

도움이 되었습니까?

해결책 2

Finally i got the link for sample jms application using Jboss 6.x. There are two ways you can configure jms queue in jboss 1.Add message queue details in jboss/server/default/deploy/hornetq/hornetq.jms.xm

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

2.create xml file in your workspace and add the message queue details

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

Maintain this file under META-INF folder of in your workspace.

Refer this sample application.

In this example includes 1.How to configure jms in jboss using hornetq. 2.Sending messages to jms message queue 3.Display messages from jboss server

다른 팁

In Jboss 7 (and 6 as well) you have bundled HornetQ server. In Jboss 6 it is located in deploy\hornetq.sar. If you want to add destination you can specify it in hornetq-jms.xml file:

<topic name="myTopic">
  <entry name="/topic/myTopic"/>
</topic>
<queue name="myQueue">
  <entry name="/queue/myQueue"/>
</queue>

In Jboss 7 it looks like below:

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

You can find more information in HornetQ documentation

Also you can put your own xml file name like mysettings-hornetq-jms.xml. Put it inside the hornetq folder in the jboss6 > deploy folder.

when name the xml use -hornetq-jms.xml ( your name infront )

<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>
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top