activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r1409417 - /activemq/trunk/activemq-amqp/src/main/java/org/apache/activemq/transport/amqp/AmqpProtocolConverter.java
Date Wed, 14 Nov 2012 21:27:27 GMT
Author: chirino
Date: Wed Nov 14 21:27:27 2012
New Revision: 1409417

URL: http://svn.apache.org/viewvc?rev=1409417&view=rev
Log:
make the protocol tracing configurable.

Modified:
    activemq/trunk/activemq-amqp/src/main/java/org/apache/activemq/transport/amqp/AmqpProtocolConverter.java

Modified: activemq/trunk/activemq-amqp/src/main/java/org/apache/activemq/transport/amqp/AmqpProtocolConverter.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-amqp/src/main/java/org/apache/activemq/transport/amqp/AmqpProtocolConverter.java?rev=1409417&r1=1409416&r2=1409417&view=diff
==============================================================================
--- activemq/trunk/activemq-amqp/src/main/java/org/apache/activemq/transport/amqp/AmqpProtocolConverter.java
(original)
+++ activemq/trunk/activemq-amqp/src/main/java/org/apache/activemq/transport/amqp/AmqpProtocolConverter.java
Wed Nov 14 21:27:27 2012
@@ -85,24 +85,26 @@ class AmqpProtocolConverter {
 //    private String clientId;
 //    private final String QOS_PROPERTY_NAME = "QoSPropertyName";
     int prefetch = 100;
+    boolean trace = false;
 
     TransportImpl protonTransport = new TransportImpl();
     ConnectionImpl protonConnection = new ConnectionImpl();
 
     {
         this.protonTransport.bind(this.protonConnection);
-        this.protonTransport.setProtocolTracer(new ProtocolTracer() {
-            @Override
-            public void receivedFrame(TransportFrame transportFrame) {
-                System.out.println(String.format("%s | RECV: %s", amqpTransport.getRemoteAddress(),
transportFrame.getBody()));
-            }
-
-            @Override
-            public void sentFrame(TransportFrame transportFrame) {
-                System.out.println(String.format("%s | SENT: %s", amqpTransport.getRemoteAddress(),
transportFrame.getBody()));
-            }
-        });
+        if( trace ) {
+            this.protonTransport.setProtocolTracer(new ProtocolTracer() {
+                @Override
+                public void receivedFrame(TransportFrame transportFrame) {
+                    System.out.println(String.format("%s | RECV: %s", amqpTransport.getRemoteAddress(),
transportFrame.getBody()));
+                }
 
+                @Override
+                public void sentFrame(TransportFrame transportFrame) {
+                    System.out.println(String.format("%s | SENT: %s", amqpTransport.getRemoteAddress(),
transportFrame.getBody()));
+                }
+            });
+        }
     }
 
     void pumpProtonToSocket() {



Mime
View raw message