ARTEMIS-209 fix keepAlive

This commit is contained in:
jbertram 2015-08-14 16:19:25 -05:00
parent cbebbc43fd
commit 976174305e
2 changed files with 15 additions and 4 deletions

View File

@ -201,12 +201,13 @@ public class OpenWireConnection implements RemotingConnection, CommandVisitor {
// the connection handles pings, negotiations directly.
// and delegate all other commands to manager.
if (command.getClass() == KeepAliveInfo.class) {
dataReceived = true;
KeepAliveInfo info = (KeepAliveInfo) command;
if (info.isResponseRequired()) {
info.setResponseRequired(false);
// if we don't respond to KeepAlive commands then the client will think the server is dead and timeout
// for some reason KeepAliveInfo.isResponseRequired() is always false
protocolManager.sendReply(this, info);
}
}
else if (command.getClass() == WireFormatInfo.class) {
// amq here starts a read/write monitor thread (detect ttl?)
negotiate((WireFormatInfo) command);

View File

@ -87,6 +87,16 @@ public class SimpleOpenWireTest extends BasicOpenWireTest {
session.close();
}
@Test
public void testKeepAlive() throws Exception {
connection.start();
Thread.sleep(125000);
connection.createSession(false, 1);
}
@Test
public void testSimpleTopic() throws Exception {
connection.start();