make the protocol tracing configurable.

git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1409417 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Hiram R. Chirino 2012-11-14 21:27:27 +00:00
parent dd0b16d38b
commit cf70ce97ee
1 changed files with 13 additions and 11 deletions

View File

@ -85,12 +85,14 @@ class AmqpProtocolConverter {
// private String clientId; // private String clientId;
// private final String QOS_PROPERTY_NAME = "QoSPropertyName"; // private final String QOS_PROPERTY_NAME = "QoSPropertyName";
int prefetch = 100; int prefetch = 100;
boolean trace = false;
TransportImpl protonTransport = new TransportImpl(); TransportImpl protonTransport = new TransportImpl();
ConnectionImpl protonConnection = new ConnectionImpl(); ConnectionImpl protonConnection = new ConnectionImpl();
{ {
this.protonTransport.bind(this.protonConnection); this.protonTransport.bind(this.protonConnection);
if( trace ) {
this.protonTransport.setProtocolTracer(new ProtocolTracer() { this.protonTransport.setProtocolTracer(new ProtocolTracer() {
@Override @Override
public void receivedFrame(TransportFrame transportFrame) { public void receivedFrame(TransportFrame transportFrame) {
@ -102,7 +104,7 @@ class AmqpProtocolConverter {
System.out.println(String.format("%s | SENT: %s", amqpTransport.getRemoteAddress(), transportFrame.getBody())); System.out.println(String.format("%s | SENT: %s", amqpTransport.getRemoteAddress(), transportFrame.getBody()));
} }
}); });
}
} }
void pumpProtonToSocket() { void pumpProtonToSocket() {