【问题标题】:javax.jms.InvalidClientIDException: Broker: localhost - Client: FS_Proceduer already connected from /127.0.0.1:portjavax.jms.InvalidClientIDException: Broker: localhost - Client: FS_Proceduer 已经从 /127.0.0.1:port 连接
【发布时间】:2015-10-20 09:50:58
【问题描述】:

如何解决这个 JMSException?谢谢!

代理:本地主机 - 客户端:FS_Proceduer 已连接

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

这是由这个方法触发的:

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);
    }

是工厂问题吗?还是其他来源?

【问题讨论】:

  • 你想运行什么?您执行的步骤究竟是什么并陷入此错误?除非你包括那些很难回答这个问题

标签: activemq


【解决方案1】:

如果您将连接配置为具有相同的客户端 ID,则会收到此错误。 JMS 规范明确指出,在任何给定时间,只有一个连接可以连接到具有相同客户端 ID 的远程,解决您的配置,一切都应该正常工作。

【讨论】:

  • 为每个客户端连接提供自己的客户端 ID。
  • 如何断开或删除相同的客户端 ID?
猜你喜欢
  • 1970-01-01
  • 2020-08-17
  • 2015-10-26
  • 1970-01-01
  • 2011-04-09
  • 2020-11-19
  • 1970-01-01
  • 1970-01-01
  • 2020-01-21
相关资源
最近更新 更多