...
BacklogTracer
...
Interceptor
...
Available
...
as
...
of
...
Camel
...
2.11
...
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).
...
The
...
BacklogTracer
...
is
...
an
...
InterceptStrategy
...
which
...
can
...
be
...
applied
...
to
...
a
...
DefaultCamelContext
...
or
...
SpringCamelContext
...
to
...
ensure
...
that
...
there
...
is
...
a
...
TracerInterceptor
...
created
...
for
...
every
...
node
...
in
...
the
...
DSL.
...
You
...
can
...
enable
...
or
...
disable
...
the
...
BacklogTracer's
...
logging
...
dynamically,
...
by
...
calling
...
the
...
backlogTracer's
...
setEnabled
...
method.
Info | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| =
|
|
|
|
|
|
|
| ||||||||||
}
Camel also provides a []which has similar capabilities as this backlog tracer. The difference is that the backlog tracer is storing
capture of the message in an internal backlog queue. Where as the []is event based and logs the messages as they happen (or route to another Camel destination). Also the []has more fine grained events where it dives into []s such as the [ ]and traces the when/otherwise(s). Though the []has much more complicated logic to handle this (there is some edge-cases where this may not work). The BacklogTracer allows you to pull the messages from the backlog queues on demand. The BacklogTracer works better with JMX capable tooling as it is simpler and allow to bulk dump all its traced messages in either a POJO or XML format. And there is a Karaf command for the BacklogTracer which allows you to control the tracing from a Karaf shell. {info} h3. Options {div:class=confluenceTableSmall} || Option || Default || Description || | enabled | true | Flag to enable or disable this tracer | | backlogSize | 10 | Number of traced messages to keep in the backlog (FIFO queue). | {div} h3. Operations {div:class=confluenceTableSmall} || Option || Type || Description || | getTraceCounter | long | Gets the total number of traced messages. | | resetTraceCounter | void | To reset the trace counter. | | dumpTracedMessages(nodeId) | List<BacklogTracerEventMessage> | To dump the traced messages from the give node id. | | dumpTracedMessagesAsXml(nodeId) | String | To dump the traced messages from the give node id in XML format. | | dumpAllTracedMessages | List<BacklogTracerEventMessage> | To dump all the traced messages | | dumpAllTracedMessagesAsXml | String | To dump all the traced messages in XML format. | {div} h3. Enabling You would need to enable this using the JMX API. h3. See Also - [Tracer] - [Tracer Example] - [Debugger] - [Delay Interceptor] - [Log] |
Options
Div | |||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| |||||||||||||||||||||||||||
|
Operations
Div | |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| |||||||||||||||||||||
|
Enabling
You would need to enable this using the JMX API.