users@glassfish.java.net

Re: How to configure JMS on multiple domains?

From: Gustavo Henrique Orair <gustavo.orair_at_gmail.com>
Date: Fri, 2 Dec 2011 15:22:37 -0200

Now, your configuration is really similar to mine.

Your problem now is that your producers in domain 1 are trying to find the
JNDI entry in local JDNI server but there is no JMS resource (JNDI name for
the queue) registered in your local JNDI.
In my case, I've used explicit JNDI to the remote JNDI server to get JMS
resource queue (queue configuration).
I do not now if you can configure JNDI remote server for an specific
@Resource annotation.
Anyway, a workaround would be create the queue with the same name in both
domains.
The queue in domain1 will be created physically inside your JMS embedded
server but will not be used anyway, it will be created just for a
workaround to register the queue in your local JNDI name. Maybe, there is
an option to just created the JNDI without creating the queue in your
embedded JMS but I don't know how to do it!

The problem with this workaround is that you have to keep the queue
configuration is both domains synchronized.

Good luck to you! :)

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/2 <forums_at_java.net>

> Thanks again!
>
> In your code, did you use injection or JNDI lookup to get your connection
> factory?
>
> In my case the producer is in domain1 and the consumer is in domain2. So,
> I
> changed my set up so that domain1 only has a QueueConnectionFactory (with
> AddressList property set to "localhost:5076" which is the domain2 JMS) and
> no
> destinations. On domain2, I have no factory, but a Queue destination. My
> producer class uses injection (via the @Resource annotation) to get both
> the
> connection factory and the destination. However, under this configuration
> I
> get injection exceptions on the missing Queue in domain1.
>
>
>
> --
>
> [Message sent by forum member 'sdoca']
>
> View Post: http://forums.java.net/node/**869999<http://forums.java.net/node/869999>
>
>
>