I am building an application which will consumer messages from multiple topics, transform the message and then publish them to multiple topics. After looking up connectionfactory object, I am using this code
Connection con = cf.createConnection();
String clientId = "APP"+ con.hashCode();
con.setClientId(clientId);
and while creating durable subscribtion I am using this MessageConsumer consumer = session.CreateDurableSubscriber(topic,"DurableSubscribtion"+clientId, topic.getSelector, true);
Every connection should have unqiue client id and subscribtion name.
After a connection is closed and I try to access the same subscribtion again using hashCode of newly created connection, will this approach work? Or do i Need to specify subscritionnames like SUBSCRIBER1,SUBSCRIBER3,SUBSCRIBER2..