When a HQ non-durable, non-transacted, topic receiver is idle for more than some time, it tends to hang. It fails to receive any messages that may get subsequently published.
This behavior is impacted by the value of connection-ttl. I have been able to recreate this problem using values of 0 and 5000 for connection-ttl but am unable to recreate the behavior using the default value of 60000.
a) set connection-ttl = 5000, restart HQ server
b) start the sample listener
c) wait for approx. 10-20 seconds. You should see in the hornetq.log file, that a connection is being closed:
[hornetq-failure-check-thread] 15:07:30,709 WARNING [org.hornetq.core.protocol.core.impl.RemotingConnectionImpl] Connection failure has been detected: Did not receive ping from /172.20.15.190:3236. It is likely the client has exited or crashed without closing its connection, or the network between the server and client has failed. The connection will now be closed. [code=3]
d) Publish a few messages to the same topic
Expected Behavior: Messages will be received
Observed Behavior: Receiver receives no messages.
If you start publishing immediately after the receiver is starter, or you start publishing before the receiver is started, the JMS topic receiver will receive the messages. However if there is a break of approx 10 seconds where no messages are being published, then the topic receiver looses connectivity and hangs. So the following sequence of events will also cause the topic receiver to hang.
a) Start publisher. Publisher will publish 1 message/second, total of 10 messages
b) Immediately start topic receiver.
- Receiver starts receiving messages
c) Publisher finishes and terminates.
d) wait for approx. 10-20 seconds. You should see in the hornetq.log file, that a connection is being closed
e) Start publisher again. Publish few messages
f) Topic receiver gets nothing. Just hangs.
Attached is my HQ configuration files and a sample receiver client I used for my testing. You can use whatever means possible to publish messages to /topic/ExampleTopic