users@glassfish.java.net

[gf-users] Re: Glassfish 4.0 b89 Durable Subscriptions

From: Nigel Deakin <nigel.deakin_at_oracle.com>
Date: Tue, 06 Jan 2015 18:56:24 +0000

(For the benefit of readers, we're discussing a long0-established feature of GlassFish called "shared subscriptions",
not to be confused with the new JMS 2.0 API feature of the same name).

On 06/01/2015 17:11, MUNDT, CHRISTOPHER J CTR USAF AFWA AFWA/SEMS RM 3250-25 wrote:
>
> A couple months ago you gave us some suggestions to work with GF4.0 and a Durable Topic subscription. At the time
> we had some issues implementing your suggestions because our code was using Spring.
>
> Our developers have since created just a simple MDB app that will receive messages from a topic and output contents
> to the server.log.
>
> After several hours of testing and troubleshooting, we have not been able to get this MDB to successfully establish a
> Durable Shared Subscription to the topic under GF 3.1.2.2, GF 4.0 build 8.9 or GF 4.1 Build 13.

In each of these three cases, were you using a single GF instance or a cluster?

(The only way to tell whether the subscription was shared is to try to deploy it to a cluster and see whether it works).

>
> If we deploy the app to just a single GF instance the app will connect successfully, establish a subscription, and
> receive messages from the topic. However when we try to start up a second instance of GF as part of the cluster, we
> receive errors in both the GF Logs and the OpenMQ logs stating that the ClientID is already in use. At times I have
> also seen messages about a non-shared subscription being made but I don't have that the moment.
>
> Previously our original code worked successfully under GF 2.1.1 but have not been able to make it work on anything
> newer. Our developers are out of ideas and we are wondering if anyone has any actually been able to establish and
> consume messages using a Durable Shared Subscription with multiple Glassfish instances in a cluster??
>
> If so could you point us at an example so we can try to figure what we have misconfigured?

Essentially, if you configure a MDB to use the JMSRA resource adapter to consume messages from a topic, then if you
deploy it to a cluster, the subscription should automatically be shared between the MDB instances across the cluster
without you needing to do anything.

What activation properties did you use to configure your MDB? Could you paste a fragment from your deployment descriptor
or @MessageDriven annotation?

>
> Thanks for your assistance.

There's a little bit of docs here
http://docs.oracle.com/cd/E18930_01/html/821-2438/gjzpg.html

Nigel