0
votes

I'd like to create a shared, non-durable subscription on a topic for a message-driven EJB and was wondering how to achieve that using @MessageDriven and @ActivationConfigProperty.

I've found an article describing something similar, but I'm not sure if this applies to my problem:

The sharing of subscriptions relies on client id being set, not only for durable subscriptions (which always require client id) but for non-durable subscriptions (which do not normally require client id). If the subscription is being created by the resource adapter for use by a message-driven bean (MDB), and client id is not set, then the resource adapter will set the client id to the name of the MDB. However if the subscription is being created programmatically using the JMS API, and client id is not set, then an exception will be thrown.

Note that, in the EJB or web container, applications that create a connection using a connection factory are not permitted to set client id on the newly created connection, but must set it on the connection factory instead. This restriction is imposed by the EJB specification, though it applies to web components as well. There is no such restrictions in the application client container.

1

1 Answers

0
votes

It's not possible using the standard JavaEE MDB activation property. Pleas read section 5.4.17.7 of the EJB 3.2 specification There are different (vendor specific) approaches for this (e.g. GlassFish, Wildfly etc.)