Is there a way to reuse the client id that is automatically generated by JBoss (ie. ID:51) when reconnecting a durable subscriber? When I attempt to set the client id after creating a topic connection the following exception is throw:
javax.jms.InvalidClientIDException: clientID is not a valid ID: ID:51
The exception is throw by:
org.jboss.mq.server.JMSDestinationManager.checkID(JMSDestinationManager.java:368)
Looking at the source, this method specifically checks to see if the new id has the prefix of "ID". If it does, then it throws the exception.
Ironically, the file conf/jbossmq-state.xml has a durable subscription entry from the original connection. The following is a snippet from that file:
ID:51
SubcriptionName
TopicName
I can get this work if I define my own client IDs (as long as they do not begin with "ID"). However, I would like to use the client id assigned by JBoss ("ID:51") when I reconnect a durable subscriber.
Any ideas?
my experience is that you don't set client id at all. to use the same durable subscription, just make sure you call createTopicConnection with the same user/password. the user needs to be configured in jbossmq-state.xml