You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Joe Niski <jo...@nwea.org> on 2011/06/30 01:16:19 UTC

tcp keepalive and InvalidClientIDException

In my network of (AMQ 5.4.2) brokers, using kahadb for storage and a 
duplex networkConnector to create the broker-to-broker connection, i 
recently added "keepAlive=true" to the URIs for my transportConnectors 
in an attempt to prevent connections from between brokers from dropping:

<transportConnectors>
<transportConnector name="openwire" 
uri="tcp://0.0.0.0:${remote_openwirePortNumber}?keepAlive=true"/>
<transportConnector name="ssl" 
uri="ssl://0.0.0.0:${remote_sslPortNumber}?keepAlive=true"/>
</transportConnectors>

We're now seeing an occasional error that's never happened before - when 
a runaway producer (in a different JVM than ActiveMQ) locks up and needs 
to be restarted, we see this when it reconnects to ActiveMQ:

javax.jms.InvalidClientIDException: Broker: mia33663app008.managed.cln - 
Client: ID:mia33663app009.managed.cln-34398-1308238547494-1201:1 already 
connected from /10.122.101.231:46151
at 
org.apache.activemq.broker.region.RegionBroker.addConnection(RegionBroker.java:243) 

at 
org.apache.activemq.broker.BrokerFilter.addConnection(BrokerFilter.java:85)
at 
org.apache.activemq.advisory.AdvisoryBroker.addConnection(AdvisoryBroker.java:78) 

at 
org.apache.activemq.broker.BrokerFilter.addConnection(BrokerFilter.java:85)
at 
org.apache.activemq.broker.BrokerFilter.addConnection(BrokerFilter.java:85)
at 
org.apache.activemq.broker.BrokerFilter.addConnection(BrokerFilter.java:85)
at 
org.apache.activemq.security.JaasAuthenticationBroker.addConnection(JaasAuthenticationBroker.java:90) 

at 
org.apache.activemq.broker.BrokerFilter.addConnection(BrokerFilter.java:85)
at 
org.apache.activemq.broker.MutableBrokerFilter.addConnection(MutableBrokerFilter.java:91) 

at 
org.apache.activemq.broker.TransportConnection.processAddConnection(TransportConnection.java:696) 

at 
org.apache.activemq.broker.jmx.ManagedTransportConnection.processAddConnection(ManagedTransportConnection.java:83) 

at 
org.apache.activemq.command.ConnectionInfo.visit(ConnectionInfo.java:137)
at 
org.apache.activemq.broker.TransportConnection.service(TransportConnection.java:311) 

at 
org.apache.activemq.broker.TransportConnection$1.onCommand(TransportConnection.java:185) 

at 
org.apache.activemq.transport.TransportFilter.onCommand(TransportFilter.java:69) 

at 
org.apache.activemq.transport.WireFormatNegotiator.onCommand(WireFormatNegotiator.java:113) 

at 
org.apache.activemq.transport.InactivityMonitor.onCommand(InactivityMonitor.java:228) 

at 
org.apache.activemq.transport.TransportSupport.doConsume(TransportSupport.java:83) 

at 
org.apache.activemq.transport.tcp.TcpTransport.doRun(TcpTransport.java:220)
at org.apache.activemq.transport.tcp.TcpTransport.run(TcpTransport.java:202)

Examining the ActiveMQ web console shows that the connection is indeed 
in place. But that's after the application - in fact, the entire app 
server (Geronimo 2.1.7) has been shutdown and restarted.

This seems similar to https://issues.apache.org/jira/browse/AMQ-2831 - 
the same behavior, but using a tcp or ssl connection rather than http. 
Could this behavior - ActiveMQ not dropping the connection even though 
the client has gone offline - be caused by the keepalive setting?

For what it's worth, enabling keepalive was an (unsuccessful) attempt to 
resolve this problem: https://issues.apache.org/jira/browse/AMQ-3353.

Thanks in advance,
Joe

-- 

*Joe Niski*
Senior Developer - Information Services | NWEA™

PHONE 503.548.5207 | FAX 503.639.7873

NWEA.ORG <http://www.nwea.org/> | Partnering to help all kids learn™