An additional question: does the message listener thread, the one that invokes onMessage() also respond to server "keep alive" ping requests? The reason I ask is that I have a sneaking suspicion that if the thread that invokes onMessage() is tied up with processing lots of business logic then it is not in a position to respond to ping messages thereby making JBoss think that the client is not responding and then closing the connection.
The onMessage processing happens in its own separate thread.
It looks like pingPeriod set to zero disables it.
1307 * Start the ping thread
1309 private void startPingThread()
1311 // Ping thread does not need to be running if the ping period is 0.
1312 if (pingPeriod == 0)
1314 pingTaskId = clockDaemon.executePeriodically(pingPeriod, new PingTask(), true);