ARTEMIS-209 fix keepAlive
This commit is contained in:
parent
cbebbc43fd
commit
976174305e
|
@ -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);
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Reference in New Issue