public final class BacklogDebugger
extends org.apache.camel.support.service.ServiceSupport
Debugger
that has easy debugging functionality which can be used from JMX with
ManagedBacklogDebuggerMBean
.
This implementation allows to set breakpoints (with or without a condition) and inspect the Exchange
dumped
in XML in BacklogTracerEventMessage
format. There is operations to resume suspended breakpoints to continue
routing the Exchange
. There is also step functionality so you can single step a given Exchange
.
This implementation will only break the first Exchange
that arrives to a breakpoint. If Camel routes using
concurrency then sub-sequent Exchange
will continue to be routed, if there breakpoint already holds a
suspended Exchange
.Modifier and Type | Method and Description |
---|---|
void |
addBreakpoint(String nodeId) |
void |
addConditionalBreakpoint(String nodeId,
String language,
String predicate) |
boolean |
afterProcess(org.apache.camel.Exchange exchange,
org.apache.camel.Processor processor,
org.apache.camel.NamedNode definition,
long timeTaken) |
boolean |
beforeProcess(org.apache.camel.Exchange exchange,
org.apache.camel.Processor processor,
org.apache.camel.NamedNode definition) |
static BacklogDebugger |
createDebugger(org.apache.camel.CamelContext context)
Creates a new backlog debugger.
|
void |
disableBreakpoint(String nodeId) |
void |
disableDebugger() |
protected void |
doStart() |
protected void |
doStop() |
String |
dumpTracedMessagesAsXml(String nodeId) |
void |
enableBreakpoint(String nodeId) |
void |
enableDebugger() |
static BacklogDebugger |
getBacklogDebugger(org.apache.camel.CamelContext context)
A helper method to return the BacklogDebugger instance if one is enabled
|
int |
getBodyMaxChars() |
Set<String> |
getBreakpoints() |
long |
getDebugCounter() |
long |
getFallbackTimeout() |
String |
getLoggingLevel() |
Set<String> |
getSuspendedBreakpointNodeIds() |
org.apache.camel.Exchange |
getSuspendedExchange(String id)
Gets the exchanged suspended at the given breakpoint id or null if there is none at that id.
|
boolean |
hasBreakpoint(String nodeId) |
boolean |
isBodyIncludeFiles() |
boolean |
isBodyIncludeStreams() |
boolean |
isEnabled() |
boolean |
isSingleStepMode() |
void |
removeAllBreakpoints() |
void |
removeBreakpoint(String nodeId) |
void |
removeMessageBodyOnBreakpoint(String nodeId) |
void |
removeMessageHeaderOnBreakpoint(String nodeId,
String headerName) |
void |
resetDebugCounter() |
void |
resumeAll() |
void |
resumeBreakpoint(String nodeId) |
void |
setBodyIncludeFiles(boolean bodyIncludeFiles) |
void |
setBodyIncludeStreams(boolean bodyIncludeStreams) |
void |
setBodyMaxChars(int bodyMaxChars) |
void |
setFallbackTimeout(long fallbackTimeout) |
void |
setLoggingLevel(String level) |
void |
setMessageBodyOnBreakpoint(String nodeId,
Object body) |
void |
setMessageBodyOnBreakpoint(String nodeId,
Object body,
Class<?> type) |
void |
setMessageHeaderOnBreakpoint(String nodeId,
String headerName,
Object value) |
void |
setMessageHeaderOnBreakpoint(String nodeId,
String headerName,
Object value,
Class<?> type) |
void |
step() |
void |
stepBreakpoint(String nodeId) |
build, doBuild, doFail, doInit, doLifecycleChange, doResume, doShutdown, doSuspend, fail, getStatus, init, isBuild, isInit, isNew, isRunAllowed, isShutdown, isStarted, isStarting, isStartingOrStarted, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, start, stop, suspend
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public static BacklogDebugger createDebugger(org.apache.camel.CamelContext context)
context
- Camel contextpublic static BacklogDebugger getBacklogDebugger(org.apache.camel.CamelContext context)
public String getLoggingLevel()
public void setLoggingLevel(String level)
public void enableDebugger()
public void disableDebugger()
public boolean isEnabled()
public boolean hasBreakpoint(String nodeId)
public boolean isSingleStepMode()
public void addBreakpoint(String nodeId)
public void addConditionalBreakpoint(String nodeId, String language, String predicate)
public void removeBreakpoint(String nodeId)
public void removeAllBreakpoints()
public void resumeBreakpoint(String nodeId)
public void setMessageBodyOnBreakpoint(String nodeId, Object body, Class<?> type)
public void removeMessageBodyOnBreakpoint(String nodeId)
public void setMessageHeaderOnBreakpoint(String nodeId, String headerName, Object value) throws org.apache.camel.NoTypeConversionAvailableException
org.apache.camel.NoTypeConversionAvailableException
public void setMessageHeaderOnBreakpoint(String nodeId, String headerName, Object value, Class<?> type) throws org.apache.camel.NoTypeConversionAvailableException
org.apache.camel.NoTypeConversionAvailableException
public long getFallbackTimeout()
public void setFallbackTimeout(long fallbackTimeout)
public void removeMessageHeaderOnBreakpoint(String nodeId, String headerName)
public void resumeAll()
public void stepBreakpoint(String nodeId)
public void step()
public org.apache.camel.Exchange getSuspendedExchange(String id)
id
- - node id for the breakpointpublic void disableBreakpoint(String nodeId)
public void enableBreakpoint(String nodeId)
public int getBodyMaxChars()
public void setBodyMaxChars(int bodyMaxChars)
public boolean isBodyIncludeStreams()
public void setBodyIncludeStreams(boolean bodyIncludeStreams)
public boolean isBodyIncludeFiles()
public void setBodyIncludeFiles(boolean bodyIncludeFiles)
public long getDebugCounter()
public void resetDebugCounter()
public boolean beforeProcess(org.apache.camel.Exchange exchange, org.apache.camel.Processor processor, org.apache.camel.NamedNode definition)
public boolean afterProcess(org.apache.camel.Exchange exchange, org.apache.camel.Processor processor, org.apache.camel.NamedNode definition, long timeTaken)
protected void doStart() throws Exception
doStart
in class org.apache.camel.support.service.BaseService
Exception
Apache Camel