users@glassfish.java.net

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

From: <glassfish_at_javadesktop.org>
Date: Tue, 08 Jan 2008 02:58:32 PST

Hi all!

I'd like to configure an MDB to be attached to a queue which is on another server, both servers are GF b58g. How can I do that?

I tried as shown in the j2ee tutorial, but there's a bug related to it:
https://glassfish.dev.java.net/issues/show_bug.cgi?id=3462

What I did is this:
- I created QueueA ( jndiname: jms/QueueA ) on ServerA.
- I created RemoteQueue ( jndiname: jms/RemoteQueue ) on ServerB: Admin Console > Resources > Connectors > Admin Object Resources. I've set it's "Name" property to the physical name of QueueA (QueueA).
- I created a new ConnectionFactory (jndiname: jms/RemoteConnectionFactory). Deleted all it's properties, then added "AddressList" with value: "mq://192.168.1.25:1273/jms" where 192.168.1.25 is ServerA's IP address, and 1273 is the JMS port (default is 7676).

- My MDB looks like this:

@MessageDriven( mappedName = "jms/RemoteQueue" )
public class RecieverMDB implements MessageListener { ... }

- The MDB's deployment descriptor:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sun-ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Application Server 9.0 EJB 3.0//EN" "http://www.sun.com/software/appserver/dtds/sun-ejb-jar_3_0-0.dtd">
<sun-ejb-jar>
  <enterprise-beans>
    <ejb>
      <ejb-name>RecieverMDB</ejb-name>
      <mdb-connection-factory>
        <jndi-name>jms/RemoteConnectionFactory</jndi-name>
      </mdb-connection-factory>
    </ejb>
  </enterprise-beans>
</sun-ejb-jar>

A workaround to the mentioned bug above is claimed to be setting JMS host from default value EMBEDDED to LOCAL. I tried setting it on only ServerA, ServerB and on both servers, still won't work. (my MDB does not recieve any messages). Howewer if I put a new message into QueueA with a standalone client using a connectionfactory on ServerA and I set up a consumer on RemoteQueue on ServerB it works.

So, what am I supposed to do?

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

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