Connection failed: javax.jms.JMSException: Channel was inactive for too long
Environment
Red Hat AMQ
- 6.x
Issue
What does it mean when I see the following messages?
| INFO | Transport failed: org.apache.activemq.transport.InactivityIOException: Channel was inactive for too (>30000) long: /209.11
4.76.133:63070 | org.apache.activemq.broker.TransportConnection.Transport | InactivityMonitor Async Task: java.util.concurrent.ThreadPoolExecutor$Worker@1bc
1452
or
| WARN | | broker | | tivityMonitor Worker | Transport | | | | | | | | | | | | Transport Connection to: tcp://1.2.3.4:61616 failed: org.apache.activemq.transport.InactivityIOException: Channel was inactive for too (>30000) long: tcp://1.2.3.4:1234
Resolution
The class org.apache.activemq.transport.InactivityMonitor runs monitoring threads to check the read and write of the transport (TCP for example). If it hasn't sent the message during the given period, it sends a KeepAliveInfo to ensure the connectivity. If it doesn't receive the message for a given duration, then it disconnects the transport.
By default, the maximumInactivityDuration is 30000 milliseconds. You can configure this on your wire format by overriding the wireFormat.maxInactivityDuration on the broker url, for example:
tcp://localhost:61616?wireFormat.maxInactivityDuration=0
Some examples of why this might occur would be a network problem or slow connection or perhaps a hung consumer. Basically, something was keeping the channel open but there was no activity.
For additional information, please refer to the transport doc on wire formats.
Root Cause
The default inactivity duration is 30000 milliseconds. If there is no activity on the connection within this period of time, the "Channel was inactive for too long" warning will be raised.
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.
Comments