title: Why inactivity monitor in activemq displaying this message often?
body: <p>We are using <strong>ActiveMQ queue</strong> to receive the messages which sent from our client program, in our server we using the ActiveMQ version 5.11, and for the client side we using ActiveMQ client version 5.4.1. We used <strong>inactivity monitor</strong> to drop the connection which used to send message to server from <strong>client</strong> by mention the <strong>time interval</strong> as <strong>30 seconds</strong> and in the <strong>server</strong> we used <strong>usekeepalive=false</strong> to drop the connection after the mentioned interval at client side.</p>
  
  <p>In normal case this works fine and get the log in client as follows :</p>
  
  <pre><code>2016-04-03 12:27:40,590 [DEBUG] (InactivityMonitor) – 9999 ms elapsed since last write check.
  2016-04-03 12:27:50,591 [DEBUG] (InactivityMonitor) – 10001 ms elapsed since last write check.
  2016-04-03 12:28:00,591 [DEBUG] (InactivityMonitor) – 10000 ms elapsed since last write check.
  2016-04-03 12:28:00,591 [DEBUG] (InactivityMonitor) – 30000 ms elapsed since last read check.
  2016-04-03 12:28:10,590 [DEBUG] (InactivityMonitor) – 9999 ms elapsed since last write check.
  2016-04-03 12:28:20,591 [DEBUG] (InactivityMonitor) – 10001 ms elapsed since last write check.
  2016-04-03 12:28:30,590 [DEBUG] (InactivityMonitor) – 29999 ms elapsed since last read check.
  2016-04-03 12:28:30,590 [DEBUG] (InactivityMonitor) – 9999 ms elapsed since last write check.
  2016-04-03 12:28:30,590 [DEBUG] (InactivityMonitor) – No message received since last read check for ssl://IM-WS-U-25/192.168.0.46:61616! Throwing InactivityIOException.
  2016-04-03 12:28:30,591 [DEBUG] (ActiveMQConnection) – Async exception with no exception listener: org.apache.activemq.transport.InactivityIOException: Channel was inactive for too (&gt;30000) long: IM-WS-U-25/192.168.0.46:61616
  org.apache.activemq.transport.InactivityIOException: Channel was inactive for too (&gt;30000) long: IM-WS-U-25/192.168.0.46:61616
      at org.apache.activemq.transport.InactivityMonitor$4.run(InactivityMonitor.java:186)
      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
      at java.lang.Thread.run(Thread.java:662)
  2016-04-03 12:28:30,592 [DEBUG] (TcpTransport) – Stopping transport ssl://IM-WS-U-25/192.168.0.46:61616
  </code></pre>
  
  <p>In exceptional cases we get the log in client as follows : (This following log prints often and fill the log with in a minute)</p>
  
  <pre><code>2016-04-03 18:02:09,469 [DEBUG] (InactivityMonitor)  0 ms elapsed since last write check.
  2016-04-03 18:02:09,469 [DEBUG] (InactivityMonitor)  0 ms elapsed since last write check.
  2016-04-03 18:02:09,469 [DEBUG] (InactivityMonitor)  0 ms elapsed since last write check.
  2016-04-03 18:02:09,469 [DEBUG] (InactivityMonitor)  0 ms elapsed since last write check.
  2016-04-03 18:02:09,469 [DEBUG] (InactivityMonitor)  0 ms elapsed since last write check.
  2016-04-03 18:02:09,469 [DEBUG] (InactivityMonitor)  0 ms elapsed since last write check.
  2016-04-03 18:02:09,469 [DEBUG] (InactivityMonitor)  0 ms elapsed since last write check.
  2016-04-03 18:02:09,469 [DEBUG] (InactivityMonitor)  0 ms elapsed since last write check.
  2016-04-03 18:02:09,469 [DEBUG] (InactivityMonitor)  0 ms elapsed since last write check.
  2016-04-03 18:02:09,469 [DEBUG] (InactivityMonitor)  0 ms elapsed since last write check.
  2016-04-03 18:02:09,469 [DEBUG] (InactivityMonitor)  0 ms elapsed since last write check.
  </code></pre>
  
  <p>And in another exceptional case we get the log as follows : (The inactivity monitor interval 30 seconds doesn't meet in most of time) 
  <strong>We suspect this may give any impact to not close the connection after 30 seconds between server and client.</strong></p>
  
  <pre><code>2016-04-04 20:14:15,340 [DEBUG] (InactivityMonitor)  9918 ms elapsed since last write check.
  2016-04-04 20:14:24,866 [DEBUG] (InactivityMonitor)  10009 ms elapsed since last write check.
  2016-04-04 20:14:25,385 [DEBUG] (InactivityMonitor)  10045 ms elapsed since last write check.
  2016-04-04 20:14:34,865 [DEBUG] (InactivityMonitor)  29848 ms elapsed since last read check.
  2016-04-04 20:14:54,860 [DEBUG] (InactivityMonitor)  9995 ms elapsed since last write check.
  2016-04-04 20:14:55,340 [DEBUG] (InactivityMonitor)  9976 ms elapsed since last write check.
  2016-04-04 20:15:04,856 [DEBUG] (InactivityMonitor)  9996 ms elapsed since last write check.
  2016-04-04 20:15:04,857 [DEBUG] (InactivityMonitor)  29992 ms elapsed since last read check.
  </code></pre>
  
  <p>And in another exceptional case we get the log as follows :</p>
  
  <pre><code>2016-04-03 18:01:57,582 [DEBUG] (InactivityMonitor)  Aborting read check.. Not enough time elapsed since last read check.
  2016-04-03 18:01:57,582 [DEBUG] (InactivityMonitor)  23026 ms elapsed since last read check.
  2016-04-03 18:01:57,582 [DEBUG] (InactivityMonitor)  Aborting read check.. Not enough time elapsed since last read check.
  2016-04-03 18:01:57,582 [DEBUG] (InactivityMonitor)  23026 ms elapsed since last read check.
  2016-04-03 18:01:57,582 [DEBUG] (InactivityMonitor)  Aborting read check.. Not enough time elapsed since last read check.
  2016-04-03 18:01:57,582 [DEBUG] (InactivityMonitor)  23026 ms elapsed since last read check.
  2016-04-03 18:01:57,582 [DEBUG] (InactivityMonitor)  Aborting read check.. Not enough time elapsed since last read check.
  2016-04-03 18:01:57,582 [DEBUG] (InactivityMonitor)  23026 ms elapsed since last read check.
  2016-04-03 18:01:57,582 [DEBUG] (InactivityMonitor)  Aborting read check.. Not enough time elapsed since last read check.
  2016-04-03 18:01:57,582 [DEBUG] (InactivityMonitor)  23026 ms elapsed since last read check.
  </code></pre>
  
  <p>We don't know why the same scenario working fine for some time and not working for many times. Cause of this we cannot able to send message from client to server and this make overhead of client process and make client not allow to do the normal process.</p>
  
  <p>Can any one please explain me why this happening in <strong>JMS</strong> with using <strong>ActiveMQ</strong>? </p>
  
  <p>Thanks in advance.</p>