users@glassfish.java.net

Re: How to configure JMS on multiple domains?

From: Gustavo Henrique Orair <gustavo.orair_at_gmail.com>
Date: Thu, 1 Dec 2011 21:49:12 -0200

First of all, I am a Glassfish user not a glassfish developer and my
knowledge are by experience.

When I said that I kept JMS Server configuration in both domains intact, I
mean I have never opened or changed anything the the page ->Configuration
-> server-config -> Java Message Server.

My JMS consumers are MDBs and at least to the best of my knowledge there is
no configuration of Connection Factories for MDBs, so, the JMS Connection
Factory defined in your domain2 are really being ignored. The MDBs in
domain2 are trying to connect to the queue you have defined inside domain2
embedded JMS server and are not finding any messages.

Notice that, JNDI lookups seems like to just get configuration information
of JMS resources.
What is happening to you is that your JMS "producers" get JMS resources by
JNDI and access the connection factory and queue define inside embedded JMS
server.
Your MDBs just get the JMS queue resource from JNDI and try to access its
local embedded JMS server and it really find this queue empty.

In my experience, I suggest to you to create the queue just in the domain
with the MDB, i.e. in your case, just use the embedded JMS server in
domain2.
You do not need a connection factory created in domain2. Just create the
connection factory in domain1 accessing the JMS Server in domain2.

BR,
---------------------------------------------------------------------------------------------------------------------
                               Gustavo Henrique Orair
 Mestre em Ciência da Computação - MSc in Computer Science
                                    Universidade Federal de Minas Gerais
               Celular/Cell phone: 55-31-85157887
------------------------------------------------------------------------------------------------------------------


2011/12/1 <forums_at_java.net>

> Hi,
>
> I'm not sure what you mean when you state you "kept JMS Server
> configuration
> in both domains intact." Do you mean you just didn't change any of the
> default config/setup after creating the domains? Do you have the JMS type
> set to "EMBEDDED", "LOCAL" or "REMOTE" in your server-config?
>
> I've reset both my domains to use an EMBEDDED broker. Maybe that's wrong?
> If so, what should they be?
>
> In my *domain1 *which has a war deployed that produces messages for
> Queue1, I
> have this set up:
>
> <jms-service default-jms-host="default_JMS_**host" type="EMBEDDED">
> <jms-host
> port="7676" host="localhost" name="default_JMS_host"/> </jms-service>
> <connector-connection-pool name="jms/**QueueConnectionFactory"
> resource-adapter-name="jmsra" is-connection-validation-**required="true"
> connection-definition-name="**javax.jms.**QueueConnectionFactory">
> </connector-connection-pool> <admin-object-resource res-adapter="jmsra"
> res-type="javax.jms.Topic" description="" jndi-name="jms/Queue1"> <property
> description="null" name="Name" value="Queue1"/> </admin-object-resource>
> and in my *domain2 *which has an ear deployed that consumes messages from
> Queue1, I have this set up:
>
> <jms-service default-jms-host="default_JMS_**host" type="EMBEDDED">
> <jms-host
> port="5076" host="localhost" name="default_JMS_host"/> </jms-service>
> <connector-connection-pool name="jms/**QueueConnectionFactory"
> resource-adapter-name="jmsra" is-connection-validation-**required="true"
> connection-definition-name="**javax.jms.**QueueConnectionFactory">
> <property
> name="AddressList" value="localhost:7676"/> </connector-connection-pool>
> <admin-object-resource res-adapter="jmsra" res-type="javax.jms.Topic"
> description="" jndi-name="jms/**ProcessBatchQueue"> <property
> description="null" name="Name" value="ProcessBatchQueue"/>
> </admin-object-resource>
> The only differences between the two configs is that domain1 uses port 7676
> for JMS and domain2 uses 5076 and domain2 has an "AddressList" property set
> for the QueueConnectionFactory.
>
> There are messages being put on Queue1 from the war in domain1 as can be
> verified by running *imqcmd list dst -b localhost:7676* on the CLI.
> However, these are not being consumed, and indeed have no consumers
> registered:
>
> Listing all the destinations on the broker specified by:
> ------------------------- Host Primary Port -------------------------
> localhost 7676
> ------------------------------**------------------------------**
> ------------------------------**---------
> Name Type State Producers Consumers Msgs Total Wildcard Total Wildcard
> Count
> Remote UnAck Avg Size
> ------------------------------**------------------------------**
> ------------------------------**---------
> Queue1 Queue RUNNING 0 - 0 - 4 0 0 148.0 Successfully listed destinations.
> When I run the list command for port 5076, I get this:
>
> Listing all the destinations on the broker specified by:
> ------------------------- Host Primary Port -------------------------
> localhost 5076
> ------------------------------**------------------------------**
> ------------------------------**---------------
> Name Type State Producers Consumers Msgs Total Wildcard Total Wildcard
> Count
> Remote UnAck Avg Size
> ------------------------------**------------------------------**
> ------------------------------**---------------
> Queue1 Queue RUNNING 0 0 1 0 0 0 0 0.0 Successfully listed destinations.
> This one does have a consumer registered. This must be the consumer that
> should be consuming messages from the broker on port 7676. So, it appears
> the AddressList property has no effect.
>
> Can you see anything wrong/different with my setup?
>
> (Note that domain2 was created with the --portbase option; I used 5000)
>
>
>
> --
>
> [Message sent by forum member 'sdoca']
>
> View Post: http://forums.java.net/node/**869999<http://forums.java.net/node/869999>
>
>
>