users@glassfish.java.net

[gf-users] Cannot connect multiple GF to remote OpenMQ

From: Will Hartung <willh_at_mirthcorp.com>
Date: Fri, 6 Feb 2015 17:41:09 -0800

I have two GF 3.1.2 instances. They are not clustered.

I have a single, remote JMS OpenMQ instance.

OpenMQ was simply started:

./imqbrokerd -name TestBroker -port 9999

I then created two new GF domains, and set up the JMS Host to point to
localhost:9999 in each one, and set the JMS to REMOTE.

I then created a simple jms/ConnectionFactory, and a simple jms/CallbackTopic.

Finally, in Netbeans, I created a simple EJB module. In there, I
created a boiler plate MDB against the topic:

@MessageDriven(mappedName = "jms/CallbackTopic", activationConfig = {
    @ActivationConfigProperty(propertyName = "destinationType",
propertyValue = "javax.jms.Topic"),
    @ActivationConfigProperty(propertyName = "clientId", propertyValue
= "jms/CallbackTopic"),
    @ActivationConfigProperty(propertyName = "subscriptionName",
propertyValue = "jms/CallbackTopic")
})
public class NewMessageBean implements MessageListener {

    public NewMessageBean() {
    }

    @Override
    public void onMessage(Message message) {
    }

}

Finally, I deploy the resulting jar to the first GF instance. That works fine.

When I deploy it to the second instance, I get:

Caused by: javax.resource.NotSupportedException:
MQRA:EC:Error:createRemoteMessageConsumer failed:aborting due
to:[C4052]: Client ID is already in use - jms/CallbackTopic
user=guest, broker=localhost:9999(52534)
        at com.sun.messaging.jms.ra.EndpointConsumer.createRemoteMessageConsumer(EndpointConsumer.java:478)
        at com.sun.messaging.jms.ra.EndpointConsumer._init(EndpointConsumer.java:308)
        at com.sun.messaging.jms.ra.EndpointConsumer.<init>(EndpointConsumer.java:185)
        at com.sun.messaging.jms.ra.ResourceAdapter.endpointActivation(ResourceAdapter.java:478)
        at com.sun.enterprise.connectors.inbound.ConnectorMessageBeanClient.setup(ConnectorMessageBeanClient.java:225)

The topic is not (should not be) a Durable topic.

We don't have any of these issues with queues.

This is the simple test case, but it mimics our desires in production.

We have 2 instances of GF running the identical app and load balanced,
but they are not clustered in any official sense. We have no desire to
cluster our GF instances. Nor do we have any interest in having a
separate build for each leg (that's a maintenance nightmare).

So is there some way to get this to work?

Thanks!

Regards,

Will Hartung
(willh_at_mirthcorp.com)

-- 
This message, and any documents attached hereto, may contain confidential 
or proprietary information intended only for the use of the addressee(s) 
named above or may contain information that is legally  privileged. If you 
are not the intended addressee, or the person responsible for delivering it 
to the intended addressee, you are hereby notified that reading, 
disseminating, distributing or copying this message is strictly prohibited. 
If you have received this message by mistake, please immediately notify us 
by replying to the message and delete the original message and any copies 
immediately thereafter.  Thank you for your cooperation.