public class Tracer extends Object implements Runnable
AMQP 0-9-1 protocol traffic capture program. Listens on a port (in-port) and when a
connection arrives, makes an outbound connection to a host and
port (out-port). Relays frames from the in-port to the out-port.
Commands are decoded and printed to a supplied Tracer.Logger.
The stand-alone program (main(String[])) prints to System.out,
using a private Tracer.AsyncLogger instance. When the connection closes
the program listens for a subsequent connection and traces that to the same Tracer.Logger.
This continues until the program is interrupted.
Options for controlling, for example, whether command bodies are decoded,
are obtained from System.properties, and are reported to the console
before starting the trace.
These constructors block waiting for a connection to arrive on the listenPort.
Tracing does not begin until the tracer is start()ed which Tracer.Logger.start()s
the supplied logger and creates and starts a Thread for relaying and deconstructing the frames.
props are used at start() time and may be modified
before this call.Tracer.Logger,
Tracer.AsyncLogger| Modifier and Type | Class and Description |
|---|---|
static class |
Tracer.AsyncLogger
|
static interface |
Tracer.Logger
Logging strings to an outputStream.
|
| Constructor and Description |
|---|
Tracer(int listenPort,
String id,
String host,
int port,
Tracer.Logger logger,
Properties props) |
Tracer(String id) |
Tracer(String id,
Properties props) |
| Modifier and Type | Method and Description |
|---|---|
void |
log(String message) |
void |
logException(Exception e) |
static void |
main(String[] args) |
void |
run() |
void |
start() |
public Tracer(int listenPort,
String id,
String host,
int port,
Tracer.Logger logger,
Properties props)
throws IOException
IOExceptionpublic Tracer(String id) throws IOException
IOExceptionpublic Tracer(String id, Properties props) throws IOException
IOExceptionCopyright © 2016 Pivotal Software, Inc.. All rights reserved.