Architecture

Backlog debugger

qianmoQqianmoQ· 更新于 2026-09-22· 阅读 14 分钟· 0 次阅读

登录后可跨设备保存划线和私人笔记登录

BacklogDebugger

Camel supports a backlog debugger that is used for live debugging of messages that are routed in Camel. The backlog debugger has additional functionality for easier debugging aimed at tooling, than the Debugger. The backlog debugger is exposed in JMX in the tracer node with the name BacklogDebugger. The JMX API is defined in the org.apache.camel.api.management.mbean.ManagedBacklogDebuggerMBean interface.

You can enable or disable the BacklogDebugger dynamically, by calling enableDebugger or disableDebugger methods.

This requires to enabled JMX by including camel-management JAR in the classpath.

Options

OptionDefaultDescription
bodyIncludeFilestrueWhether to include the message body of file based messages. The overhead is that the file content has to be read from the file.
bodyIncludeStreamsfalseWhether 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.
bodyMaxChars32kbTo limit the message body to a maximum size in the traced message. Use 0 or negative value to use unlimited size.
includeExchangePropertiestrueWhether to include the exchange properties in the traced message.
includeExchangeVariablestrueWhether to include the exchange variables in the traced message.
standbyfalseWhether the debugger is standby. If a debugger is in standby then the debugger is activated during startup and are ready to be enabled manually via JMX or calling the enableDebugger method.
enabledfalseWhether the debugger is enabled or not.
singleStepModefalseWhether currently in single step mode of a single Exchange.
singleStepLastfalseIn single step mode, then when the exchange is complete, then simulate a breakpoint as last, that allows to suspend and watch the exchange when complete (you can see message body as response, failed exception etc).

Operations

OptionTypeDescription
addBreakpoint(nodeId)voidTo add a breakpoint at the given node.
addConditionalBreakpoint(nodeId, language, predicate)voidTo add a conditional breakpoint at the given node. The predicate is created from the language parameter.
disableBreakpoint(nodeId)voidTo disable a breakpoint.
disableDebuggervoidTo disable the debugger
dumpTracedMessagesAsXml(nodeId)StringTo dump the debugged messages from the give node id in XML format.
dumpTracedMessagesAsXml(nodeId, boolean)StringTo dump the debugged messages from the give node id in XML format, optionally including the exchange properties.
enableBreakpoint(nodeId)voidTo activate a breakpoint which has been disabled.
enableDebuggervoidTo enable the debugger
evaluateExpressionAtBreakpoint(nodeId, language, expression)StringTo evaluate an expression in any supported language (e.g. Simple) and convert the result to String
evaluateExpressionAtBreakpoint(nodeId, language, expression, resultType)ObjectTo evaluate an expression in any supported language (e.g. Simple) and return the result as a given result type
getBreakpointsSet<String>To get a set of all the nodes which has a breakpoint added.
getDebuggerCounterlongGets the total number of debugged messages.
getSuspendedBreakpointNodeIdsSet<String>To get a set of all the nodes which has suspended breakpoints (eg an Exchange at the breakpoint which is suspended).
removeBreakpoint(nodeId)voidTo remove the breakpoint from the given node id.
resetDebuggerCountervoidTo reset the debugger counter.
resumeAllvoidTo resume all suspended breakpoints.
resumeBreakpoint(nodeId)voidTo resume a suspend breakpoint, which will then continue routing the Exchange.
setExchangePropertyOnBreakpoint(nodeId,exchangePropertyName,value)voidTo update/add the Exchange property on the suspended Exchange at the node.
setFallbackTimeout(value)longFallback Timeout in seconds (300 seconds as default) when block the message processing in Camel. A timeout used for waiting for a message to arrive at a given breakpoint. `
setMessageBodyOnBreakpoint(nodeId,body)voidTo update the message body on the suspended Exchange at the node.
setMessageHeaderOnBreakpoint(nodeId,headerName,value)voidTo update/add the message header on the suspended Exchange at the node.
stepBreakpoint(nodeId)voidTo start single step mode from a suspended breakpoint at the given node. Then invoke step to step to next node in the route.
stepvoidTo step into the next node when in single step mode.
stepOvervoidTo step over the next node when in single step mode.
skipOvervoidTo skip over the next node when in single step mode.
validateConditionalBreakpointStringUsed for validating if a given predicate is valid or not. Returns null if valid, otherwise a string with the error message.
messageHistoryOnBreakpointAsXml(nodeId)StringReturns message history at the given node Id in XML format

Enabling

You would need to enable backlogger debugger using the JMX API.

See Also

See Debugger

评论

登录后参与评论

正在加载评论…