Return-Path: X-Original-To: apmail-activemq-users-archive@www.apache.org Delivered-To: apmail-activemq-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id D28B511C05 for ; Thu, 15 May 2014 12:47:40 +0000 (UTC) Received: (qmail 89815 invoked by uid 500); 15 May 2014 06:21:31 -0000 Delivered-To: apmail-activemq-users-archive@activemq.apache.org Received: (qmail 89781 invoked by uid 500); 15 May 2014 06:21:31 -0000 Mailing-List: contact users-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@activemq.apache.org Delivered-To: mailing list users@activemq.apache.org Received: (qmail 89769 invoked by uid 99); 15 May 2014 06:21:31 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 15 May 2014 06:21:31 +0000 X-ASF-Spam-Status: No, hits=2.5 required=5.0 tests=FREEMAIL_ENVFROM_END_DIGIT,SPF_SOFTFAIL,URI_HEX X-Spam-Check-By: apache.org Received-SPF: softfail (athena.apache.org: transitioning domain of khandelwal.anuj90@gmail.com does not designate 216.139.250.139 as permitted sender) Received: from [216.139.250.139] (HELO joe.nabble.com) (216.139.250.139) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 15 May 2014 06:21:27 +0000 Received: from [192.168.236.139] (helo=joe.nabble.com) by joe.nabble.com with esmtp (Exim 4.72) (envelope-from ) id 1Wkp21-0007dC-Vz for users@activemq.apache.org; Wed, 14 May 2014 23:20:41 -0700 Date: Wed, 14 May 2014 23:20:26 -0700 (PDT) From: khandelwalanuj To: users@activemq.apache.org Message-ID: <1400134826968-4681139.post@n4.nabble.com> Subject: client ID is not removed from clientIdSet while removing the connection MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org ActiveMQ version 5.8. Seeing a strange behavior where a consumer is connected to the broker but throwing "InvalidClientIDException". which says that one more connection is trying to connect to the the broker using the same client_id. But I am only creating one connection: Single consumer, subscribing to a single topic.[I am only seeing this issue with every consumer. Only sometimes this issue is happening] /org.apache.activemq.broker.TransportConnection#processAddConnection 772 WARN] - Failed to add Connection ID:barium21.nyc.*.com-42338-1399765615445-1:1, reason: javax.jms.InvalidClientIDException: Broker: mqbrokerqa - Client: JMSPonger already connected from tcp://barium21.nyc.*.com:45656 / When I checked the source code of ActiveMQ RegionBroker I suspect while remove client there are some checks which might causing this issue and not let the clientID remove from the clientIDList. Below is the source code from RegionBroker: I don;t understand why do we need to check the context and connection Id's. If we are sure that there can only be one client possible with one client ID. then why can't we directly remove that without checking conenction ID and context ? ... public void removeConnection(ConnectionContext context, ConnectionInfo info, Throwable error) throws Exception) { ..... synchronized (clientIdSet) { ConnectionContext oldValue = clientIdSet.get(clientId); // we may be removing the duplicate connection, not the first // connection to be created // so lets check that their connection IDs are the same if (oldValue == context) { if (isEqual(oldValue.getConnectionId(), info.getConnectionId())) { clientIdSet.remove(clientId); ..... } ... Thanks, Anuj -- View this message in context: http://activemq.2283324.n4.nabble.com/client-ID-is-not-removed-from-clientIdSet-while-removing-the-connection-tp4681139.html Sent from the ActiveMQ - User mailing list archive at Nabble.com.