Actually, while this is likely my problem for the debugging case, I believe that it is much more likely that in the other cases, the client closes the connection.
This happens because there is a ConnectionValidator associated with the JMS connection (not sure the exact details yet), and this is pinging every 2ms.
I don't think the ping frequency is even the real problem (though it seems alarmingly high) I think the problem is that the SO_TIMEOUT used when checking the connection is only 1 second !!!! (note this is in the jboss remoting code)
Is this really the expected behavior? Your JMS connection gets closed if pinging the server takes more than a second?
In case anyone else has this problem, i did some more digging and it seems that the latter problem (the unchangeable 1s timeout in jboss remoting) should be fixed by the following
(the latter of which is exceedingly recent and not yet released).
I'll post the results when I get a chance to play with that build.
You don't mention what version of JBM you are using. But in the latest version, the default ping is already changed to a more sensible value.
Sorry, we're using whatever comes with
JBoss 4.3.0EAP CP 03
I'm guessing that the ping requires a Java level response, so we should consider (potentially badly configured) GC pauses when setting this value ourselves.