Hi Will,
If you don't care receiving each topic message by all MDB instances, you
can just remove clientId form activation properties. But it has to be in
a cluster if you want to use Shared Topic Subscriptions.
Thanks,
David Zhao
On 2/7/15 9:41 AM, Will Hartung wrote:
> 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)
>