How do you resolve this JMSException? Thanks!
Broker: localhost - Client: FS_Proceduer already connected
javax.jms.InvalidClientIDException: Broker: localhost - Client: FS_Proceduer already connected from /127.0.0.1:56556
This is triggered by this method:
private void connectAndInitActiveMQ() throws JMSException{
logger.debug("It's ready to connect to jms service");
if(null != connection){
try{
logger.debug("Closing connection");
connection.close();
}catch(Exception e){
logger.error(e.getMessage(), e);
}
}
logger.debug("Creating a new connection");
logger.debug("Is queueConnectionFactory null? "+(queueConnectionFactory==null));
connection = queueConnectionFactory.createConnection();
logger.debug("Is the new connection null? "+(connection==null));
logger.debug("Starting the new connection");
connection.start();
logger.debug("Connected successfully: " + connection);
session = connection.createSession(true, Session.AUTO_ACKNOWLEDGE);
queue = session.createQueue(queueName);
messageProducer = session.createProducer(queue);
}
Is it the factory problem? Or some other source?
You would get this error if you configured your connections to have the same client ID. The JMS spec is explicit that only a single connection can connect to the remote with the same Client ID at any given time, resolve your configuration and things should work just fine.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With