mirror of https://github.com/apache/activemq.git
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:
parent
dd0b16d38b
commit
cf70ce97ee
|
@ -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() {
|
||||
|
|
Loading…
Reference in New Issue