users@glassfish.java.net

Re: How to attach a MDB to a queue on an other server

From: <glassfish_at_javadesktop.org>
Date: Mon, 14 Jan 2008 11:03:40 PST

Hello there,

The solution we found is this: deploy imqjmsra.rar (Glassfish's JMS's (which is Sun Java System Message Queue) resource adapter), setting it's connectionURL to the remote server's JMS location, then manually create Admin Object Resources which are using this resource adapter.

Step 1 - resource adapter deployment:
in your case i guess you have to deploy an ActiveMQ's connector module. You can deploy connector modules at Admin Console > Applications > Connector Modules.
First you select the file to deploy, then after deploying it there's a second page with the properties of the resource adapter (this page can't be shown later so be careful).
In case of imqjmsra.rar (which is included in Glassfish) you only have to set it's connectionURL property to mq://<serverHost>:<JMSPort>/jms (for example mq://192.168.0.2:7676/jms)

Step 2 - creating Connector and Admin Object resources:
- Go to Admin Console > Resources > Connectors > Admin Object Resources
- Click new...
JNDI Name: the jndi name on which you'd like to reach the remote queue on your local server
Resource Adapter: set it to the newly installed connector module's name
- If you're done here, click Next:
- Set the Name property to the PHYSICAL name of the queue on the remote server. So if your MDB is on Server B, and you've got a queue named jms/Queue with physical name QueuePhy on Server A then Name is QueuePhy (we're working on Server B now).
- Click Finish.

Now you should be able to attach an MBD to the remote queue using it's local JNDI name as if you would attach it to a real local queue.

cheers
z
[Message sent by forum member 'zoltan_kiss' (zoltan_kiss)]

http://forums.java.net/jive/thread.jspa?messageID=253811