activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From khandelwalanuj <>
Subject client ID is not removed from clientIdSet while removing the connection
Date Thu, 15 May 2014 06:20:26 GMT
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]

/ 772
WARN] - Failed to add Connection*.com-42338-1399765615445-1:1, reason:
javax.jms.InvalidClientIDException: Broker: mqbrokerqa - Client: JMSPonger
already connected from tcp://*.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

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
                                 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())) {


View this message in context:
Sent from the ActiveMQ - User mailing list archive at

View raw message