Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

javax.jms.InvalidClientIDException: Broker: localhost - Client: FS_Proceduer already connected from /127.0.0.1:port

Tags:

activemq

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?

like image 284
Philip Morris Avatar asked Jul 29 '15 12:07

Philip Morris


1 Answers

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.

like image 73
Tim Bish Avatar answered Oct 03 '22 21:10

Tim Bish