ARTEMIS-209 fix keepAlive

- Received should be set to true on any package
This commit is contained in:
Clebert Suconic 2015-08-25 18:20:59 -04:00
parent 2b45d6eb9e
commit 4b79ddb0bd
2 changed files with 4 additions and 3 deletions

View File

@ -124,7 +124,7 @@ public class OpenWireConnection implements RemotingConnection, CommandVisitor {
private final Object sendLock = new Object();
private boolean dataReceived;
private volatile boolean dataReceived;
private OpenWireFormat wireFormat;
@ -198,6 +198,8 @@ public class OpenWireConnection implements RemotingConnection, CommandVisitor {
@Override
public void bufferReceived(Object connectionID, ActiveMQBuffer buffer) {
try {
dataReceived = true;
Command command = (Command) wireFormat.unmarshal(buffer);
boolean responseRequired = command.isResponseRequired();
@ -205,7 +207,6 @@ 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;
info.setResponseRequired(false);
// if we don't respond to KeepAlive commands then the client will think the server is dead and timeout

View File

@ -351,7 +351,7 @@ public class OpenWireProtocolManager implements ProtocolManager<Interceptor>, No
String id = getBrokerId() != null ? getBrokerId().getValue() : "NOT_SET";
advisoryMessage.setStringProperty(AdvisorySupport.MSG_PROPERTY_ORIGIN_BROKER_ID, id);
String url = "tcp://localhost:61616";
String url = context.getConnection().getLocalAddress();
advisoryMessage.setStringProperty(AdvisorySupport.MSG_PROPERTY_ORIGIN_BROKER_URL, url);