You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by jb...@apache.org on 2017/12/05 15:39:41 UTC

[2/2] activemq-artemis git commit: ARTEMIS-1534 added openwire logging (trace level) to log openwire commands that are received/sent by the broker

ARTEMIS-1534 added openwire logging (trace level) to log openwire commands that are received/sent by the broker


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

Branch: refs/heads/master
Commit: 0b5bddaab55f0240c6e10044ab0a2b78e49b26b5
Parents: 3124a50
Author: Pat Fox <pa...@gmail.com>
Authored: Sat Dec 2 12:10:38 2017 +0100
Committer: Justin Bertram <jb...@apache.org>
Committed: Tue Dec 5 09:39:28 2017 -0600

----------------------------------------------------------------------
 .../core/protocol/openwire/OpenWireConnection.java       | 11 +++++++++++
 1 file changed, 11 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/0b5bddaa/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 a043108..9923953 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
@@ -261,6 +261,11 @@ public class OpenWireConnection extends AbstractRemotingConnection implements Se
 
          Command command = (Command) wireFormat.unmarshal(buffer);
 
+         // log the openwire command
+         if (logger.isTraceEnabled()) {
+            logger.trace("connectionID: " + connectionID + " RECEIVED: " + (command == null ? "NULL" : command));
+         }
+
          boolean responseRequired = command.isResponseRequired();
          int commandId = command.getCommandId();
 
@@ -434,6 +439,12 @@ public class OpenWireConnection extends AbstractRemotingConnection implements Se
    }
 
    public void physicalSend(Command command) throws IOException {
+
+      if (logger.isTraceEnabled()) {
+         logger.trace("connectionID: " + (getTransportConnection() == null ? "" : getTransportConnection().getID())
+                         + " SENDING: " + (command == null ? "NULL" : command));
+      }
+
       try {
          ByteSequence bytes = wireFormat.marshal(command);
          ActiveMQBuffer buffer = OpenWireUtil.toActiveMQBuffer(bytes);