Hi everyone,
I have MDB annotated as follows:
@MessageDriven(activationConfig = {
@ActivationConfigProperty(propertyName = "messagingType", propertyValue = "javax.jms.MessageListener"),
@ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Topic"),
@ActivationConfigProperty(propertyName = "destination", propertyValue = "topic/MOBIDISP_MOT"),
@ActivationConfigProperty(propertyName = "providerAdapterJNDI", propertyValue="java:/DefaultJMSProvider"),
@ActivationConfigProperty(propertyName = "subscriptionDurability", propertyValue="Durable"),
@ActivationConfigProperty(propertyName = "subscriptionName", propertyValue="autoresponder"),
@ActivationConfigProperty(propertyName = "messageSelector", propertyValue="application_id in ('autoresponder')")
})
After I deploy it I get a record in jmx-console cofirming that it is deployed and it is durable. The problem appears when I restart application or redeploy MDB ? it is not recognised as one which subscribed before and new durable subscription is created. Here is what I can see in jmx-console after a couple of server restarts:
...
Topic,MOBIDISP_MOT,DurableSubscription[clientId=ID:11162 name=autoresponder selector=application_id in ('UNKNOWN', 'autoresponder')],true,0,0,2,2,-
Topic,MOBIDISP_MOT,DurableSubscription[clientId=ID:1118 name=autoresponder selector=application_id in ('UNKNOWN', 'autoresponder')],true,0,0,2,2,-
Topic,MOBIDISP_MOT,DurableSubscription[clientId=ID:11183 name=autoresponder selector=application_id in ('UNKNOWN', 'autoresponder')],true,0,0,2,2,-
...
Can anybody tell me what am I doing wrong.
Thanks,
Ed
Always use "clientId" property when using durable subscriptions. http://wiki.jboss.org/wiki/Wiki.jsp?page=EJB3MessageDrivenBean