BacklogTracer
Camel supports a backlog tracer interceptor that is used for capturing a trace message of each message as they are routed in Camel. The trace message is stored in a backlog queue, which contains the last N messages for each node in the routes (by default 10).
What is the difference between BacklogTracer and Tracer
Camel also provides a Tracer which has similar capabilities as this backlog tracer. The difference is that the backlog tracer is storing a capture of the message in an internal backlog queue.
The Tracer is event based and logs the messages as they happen (or route to another Camel destination).
Use the Tracer when all you need is to log the traced messages as they happen.
The backlog tracer allows you to pull the messages from the backlog queues on demand. The backlog tracer works better with JMX capable tooling as it is simpler, allowing to bulk dump all its traced messages in either a POJO or XML format.
Options
Option | Default | Description |
---|---|---|
enabled |
|
Flag to enable or disable this tracer |
backlogSize |
|
Maximum number of total traced messages to keep in the backlog (FIFO queue). |
tracePattern |
|
Allows to filter tracing using a pattern that matches against the node
id and route id. For example use |
traceFilter |
|
Allow to configure a filter as a Predicate using
any of the Camel languages. But default the
Simple language is used. For example to filter on
messages with a given header, use |
removeOnDump |
|
Whether to remove the traced messages that was returned when invoking the dump methods. |
bodyMaxChars |
|
To limit the message body to a maximum size in the traced message. Use 0 or negative value to use unlimited size. |
bodyIncludeStreams |
|
Whether to include the message body of stream based messages. If enabled then beware the stream may not be re-readable later. See more about Stream Caching. |
bodyIncludeFiles |
|
Whether to include the message body of file based messages. The overhead is that the file content has to be read from the file. |
Operations
Option | Default | Description |
---|---|---|
getTraceCounter |
|
Gets the total number of traced messages. |
resetTraceCounter |
|
To reset the trace counter. |
dumpTracedMessages(nodeOrRouteId) |
|
To dump the traced messages from the give node or route id. |
dumpTracedMessagesAsXml(nodeOrRouteId) |
|
To dump the traced messages from the give node or route id in XML format. |
dumpAllTracedMessages |
|
To dump all the traced messages |
dumpAllTracedMessagesAsXml |
|
To dump all the traced messages in XML format. |