users@glassfish.java.net

two glassfish instances, A listening to B's message queue

From: janne mattila <jannepostilistat_at_gmail.com>
Date: Tue, 22 Jun 2010 17:32:10 +0300

I have GF instances A and B. B is running the embedded MQ. I want to deploy
a MDB on server A which would listen to a JMS queue on server B.

What I have done
- B is using default ports (MQ=7676)
- A has custom ports with --portbase
- B has 2 physical destinations phys1 and phys 2
- B has one connection factory: jms/myConnectionFactory
- B has jms/myQueue, props: Name = phys1 and jms/myQueue2, props: Name =
phys2
- B has JMS Service type = EMBEDDED, JMS Host default_JMS_host
- A has no connection factories or destination resources or physical
destinations configured
- A: I configure a new JMS Host remote_host with port etc pointing to B's MQ
- A: I change JMS Service type = remote and Default JMS Host = remote_host

If I deploy MDB to server B listening to server B's queue:

@MessageDriven(mappedName = "jms/myQueue", activationConfig = {
        @ActivationConfigProperty(propertyName = "acknowledgeMode",
propertyValue = "Auto-acknowledge"),
        @ActivationConfigProperty(propertyName = "destinationType",
propertyValue = "javax.jms.Queue")
    })
public class NewMessageBean implements MessageListener {

It works. using MQ admin tool I can see that there's current number of
active consumers = 1 on phys1.

If I deploy same MDB to server A

@MessageDriven(mappedName = "jms/myQueue", activationConfig = {
        @ActivationConfigProperty(propertyName = "acknowledgeMode",
propertyValue = "Auto-acknowledge"),
        @ActivationConfigProperty(propertyName = "destinationType",
propertyValue = "javax.jms.Queue")
    })

it does not receive the messages. Using MQ admin tool I can see that
"current number of messages" grows and "current number of active consumers"
= 0.

Instead, I can see that a new destination "PhysicalDestination" has been
added to MQ admin tool. Server A's admin tool shows that a connection
factory ( jms/myQueueFactoryPool

 ) and destination resource ( jms/myQueue) have been created unwantedly.

What am I doing wrong here?