Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to configure JMS in Jboss 6?

Tags:

java

jms

jboss6.x

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?

like image 666
Ami Avatar asked Dec 31 '13 04:12

Ami


2 Answers

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

like image 65
Jakub Kubrynski Avatar answered Oct 23 '22 21:10

Jakub Kubrynski


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

like image 2
Ami Avatar answered Oct 23 '22 20:10

Ami