Repository: activemq-artemis
Updated Branches:
  refs/heads/master 2b45d6eb9 -> 4b79ddb0b


ARTEMIS-209 fix keepAlive

- Received should be set to true on any package


Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/4b79ddb0
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/4b79ddb0
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/4b79ddb0

Branch: refs/heads/master
Commit: 4b79ddb0bd02f0a6913beb2f5d7aabf350933543
Parents: 2b45d6e
Author: Clebert Suconic <[email protected]>
Authored: Tue Aug 25 18:20:59 2015 -0400
Committer: Clebert Suconic <[email protected]>
Committed: Tue Aug 25 18:56:14 2015 -0400

----------------------------------------------------------------------
 .../artemis/core/protocol/openwire/OpenWireConnection.java      | 5 +++--
 .../artemis/core/protocol/openwire/OpenWireProtocolManager.java | 2 +-
 2 files changed, 4 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/4b79ddb0/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/OpenWireConnection.java
----------------------------------------------------------------------
diff --git 
a/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/OpenWireConnection.java
 
b/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/OpenWireConnection.java
index abe7cdf..c5644dd 100644
--- 
a/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/OpenWireConnection.java
+++ 
b/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/OpenWireConnection.java
@@ -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

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/4b79ddb0/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/OpenWireProtocolManager.java
----------------------------------------------------------------------
diff --git 
a/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/OpenWireProtocolManager.java
 
b/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/OpenWireProtocolManager.java
index fa75fcf..2554ce1 100644
--- 
a/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/OpenWireProtocolManager.java
+++ 
b/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/OpenWireProtocolManager.java
@@ -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);
 

Reply via email to