users@glassfish.java.net

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

From: janne mattila <jannepostilistat_at_gmail.com>
Date: Thu, 24 Jun 2010 12:51:50 +0300

The answer to my problem was this thread:
http://forums.java.net/jive/thread.jspa?messageID=344514

On Tue, Jun 22, 2010 at 6:29 PM, janne mattila
<jannepostilistat_at_gmail.com>wrote:

> I have also tried to configure a connectionFactory to server A so that the
> connectionFactory connects to B's remote JMS.
>
> pool name = jms/remoteConnection
> jndi name = jms/remoteConnection
> properties = AddressList = mq://localhost:7676/
>
> Then I create deployment descriptor for my bean:
>
> sun-ejb-jar.xml
>
> <sun-ejb-jar>
> <enterprise-beans>
> <ejb>
> <ejb-name>NewMessageBean</ejb-name>
> <jndi-name>jms/myQueue</jndi-name>
> <mdb-connection-factory>
> <jndi-name>jms/remoteConnection</jndi-name>
> </mdb-connection-factory>
> </ejb>
> </enterprise-beans>
> </sun-ejb-jar>
>
> Still, every time I deploy this MDB, connection factory
> jms/myQueueFactoryPool and destination resource jms/myQueue get created to
> server A.
>
>
>
> On Tue, Jun 22, 2010 at 5:32 PM, janne mattila <jannepostilistat_at_gmail.com
> > wrote:
>
>> 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?
>
>
>