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 17:16:54 -0200

I had similar issues in my environment and it was very hard to find good
doc also.

In my environment, I have an ear1 in domain1 (MDBs inside) and ear2 in
domain2 ("producers" apps that get JMS resources using explicit JNDI).
I didn't inject JMS in domain2 apps, because I want to change some of these
configurations using properties files.

I kept JMS Server configuration in both domains intact.

In the domain2, where there are "producers", I created a Connection JMS
Factory (Resources -> JMS Resources -> Connection Factories) configured to
access the JMS server embedded in domain1. I did it creating the connection
factory using asadmin (adding --property imqAddressList=localhost:7676).
Using interface you may add AddressList property with value localhost:7676
in Additional Properties.

So my producers, inside ear2 obtained the JMS queues from domain 1 JNDI
server and the JMS connection factories from domain 2 JNDI server.

Notice that, in my configuration I had MDBs in ear2 also, but I didn't
change anything from default to make it work.

I hope my solution for a similar issue would be worth to you.

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

> Due to classloading issues I need to deploy an ear and a war in separate
> domains in the same instance of Glassfish 3.1.1. The war sends messages to
> a
> queue and and MDB in the ear should receive and action it.
>
> The JMS is set up in the domains thusly:
>
> *domain1 default_JMS_host *(server-config | Java Message Service | JMS
> Hosts):
>
> Type = local Host = localhost Port = 7676
> *domain2 default_JMS_host *(server-config | Java Message Service | JMS
> Hosts):
>
> Type = remote Host = localhost Port = 7676
> Originally I had the port on domain2 set to 5076, but that caused
> connection
> refused exceptions on domain startup.
> With this setup everything seems to load fine (no errors in domain2
> server.log) but it doesn't pick up the messages put in the queue by the war
> file. I have confirmed that the messages are being put in the queue by the
> war using the command:
>
> /<glassfish>/mq/bin/imqcmd list dst -b localhost:7676 -u admin
> I have tried searching for how to set up JMS with multiple domains in the
> same Glassfish instance, but haven't found anything useful. Can someone
> point
> me to a good resource on how to set this up?
>
>
> --
>
> [Message sent by forum member 'sdoca']
>
> View Post: http://forums.java.net/node/**869999<http://forums.java.net/node/869999>
>
>
>