Package org.apache.camel.impl.debugger
Class BacklogTracer
java.lang.Object
org.apache.camel.support.service.BaseService
org.apache.camel.support.service.ServiceSupport
org.apache.camel.impl.debugger.BacklogTracer
- All Implemented Interfaces:
AutoCloseable,org.apache.camel.Service,org.apache.camel.ShutdownableService,org.apache.camel.spi.BacklogTracer,org.apache.camel.StatefulService,org.apache.camel.SuspendableService
public final class BacklogTracer
extends org.apache.camel.support.service.ServiceSupport
implements org.apache.camel.spi.BacklogTracer
A tracer used for message tracing, storing a copy of the message details in a backlog.
This tracer allows to store message tracers per node in the Camel routes. The tracers is stored in a backlog queue
(FIFO based) which allows to pull the traced messages on demand.
-
Field Summary
FieldsFields inherited from class org.apache.camel.support.service.BaseService
BUILT, FAILED, INITIALIZED, INITIALIZING, lock, NEW, SHUTDOWN, SHUTTING_DOWN, STARTED, STARTING, status, STOPPED, STOPPING, SUSPENDED, SUSPENDING -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()static BacklogTracercreateTracer(org.apache.camel.CamelContext context) Creates a new backlog tracer.protected voiddoStop()List<org.apache.camel.spi.BacklogTracerEventMessage> List<org.apache.camel.spi.BacklogTracerEventMessage> dumpTracedMessages(String nodeId) dumpTracedMessagesAsJSon(String nodeId) dumpTracedMessagesAsXml(String nodeId) intintlonglonglongbooleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanvoidvoidsetBacklogSize(int backlogSize) voidsetBodyIncludeFiles(boolean bodyIncludeFiles) voidsetBodyIncludeStreams(boolean bodyIncludeStreams) voidsetBodyMaxChars(int bodyMaxChars) voidsetEnabled(boolean enabled) voidsetIncludeException(boolean includeException) voidsetIncludeExchangeProperties(boolean includeExchangeProperties) voidsetIncludeExchangeVariables(boolean includeExchangeVariables) voidsetRemoveOnDump(boolean removeOnDump) voidsetStandby(boolean standby) voidsetTraceFilter(String filter) voidsetTracePattern(String tracePattern) voidsetTraceRests(boolean traceRests) voidsetTraceTemplates(boolean traceTemplates) booleanshouldTrace(org.apache.camel.NamedNode definition, org.apache.camel.Exchange exchange) Whether or not to trace the given processor definition.voidMethods inherited from class org.apache.camel.support.service.BaseService
build, doBuild, doFail, doInit, doLifecycleChange, doResume, doShutdown, doStart, doSuspend, fail, getInternalLock, getStatus, init, isBuild, isInit, isNew, isRunAllowed, isShutdown, isStarted, isStarting, isStartingOrStarted, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, start, stop, suspendMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.camel.Service
build, close, init, start, stopMethods inherited from interface org.apache.camel.ShutdownableService
shutdownMethods inherited from interface org.apache.camel.StatefulService
getStatus, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isSuspendingMethods inherited from interface org.apache.camel.SuspendableService
isSuspended, resume, suspend
-
Field Details
-
MAX_BACKLOG_SIZE
public static final int MAX_BACKLOG_SIZE- See Also:
-
-
Method Details
-
createTracer
Creates a new backlog tracer.- Parameters:
context- Camel context- Returns:
- a new backlog tracer
-
shouldTrace
public boolean shouldTrace(org.apache.camel.NamedNode definition, org.apache.camel.Exchange exchange) Whether or not to trace the given processor definition.- Parameters:
definition- the processor definitionexchange- the exchange- Returns:
- true to trace, false to skip tracing
-
traceEvent
-
isEnabled
public boolean isEnabled()- Specified by:
isEnabledin interfaceorg.apache.camel.spi.BacklogTracer
-
setEnabled
public void setEnabled(boolean enabled) - Specified by:
setEnabledin interfaceorg.apache.camel.spi.BacklogTracer
-
isStandby
public boolean isStandby()- Specified by:
isStandbyin interfaceorg.apache.camel.spi.BacklogTracer
-
setStandby
public void setStandby(boolean standby) - Specified by:
setStandbyin interfaceorg.apache.camel.spi.BacklogTracer
-
getBacklogSize
public int getBacklogSize()- Specified by:
getBacklogSizein interfaceorg.apache.camel.spi.BacklogTracer
-
setBacklogSize
public void setBacklogSize(int backlogSize) - Specified by:
setBacklogSizein interfaceorg.apache.camel.spi.BacklogTracer
-
isRemoveOnDump
public boolean isRemoveOnDump()- Specified by:
isRemoveOnDumpin interfaceorg.apache.camel.spi.BacklogTracer
-
setRemoveOnDump
public void setRemoveOnDump(boolean removeOnDump) - Specified by:
setRemoveOnDumpin interfaceorg.apache.camel.spi.BacklogTracer
-
getBodyMaxChars
public int getBodyMaxChars()- Specified by:
getBodyMaxCharsin interfaceorg.apache.camel.spi.BacklogTracer
-
setBodyMaxChars
public void setBodyMaxChars(int bodyMaxChars) - Specified by:
setBodyMaxCharsin interfaceorg.apache.camel.spi.BacklogTracer
-
isBodyIncludeStreams
public boolean isBodyIncludeStreams()- Specified by:
isBodyIncludeStreamsin interfaceorg.apache.camel.spi.BacklogTracer
-
setBodyIncludeStreams
public void setBodyIncludeStreams(boolean bodyIncludeStreams) - Specified by:
setBodyIncludeStreamsin interfaceorg.apache.camel.spi.BacklogTracer
-
isBodyIncludeFiles
public boolean isBodyIncludeFiles()- Specified by:
isBodyIncludeFilesin interfaceorg.apache.camel.spi.BacklogTracer
-
setBodyIncludeFiles
public void setBodyIncludeFiles(boolean bodyIncludeFiles) - Specified by:
setBodyIncludeFilesin interfaceorg.apache.camel.spi.BacklogTracer
-
isIncludeExchangeProperties
public boolean isIncludeExchangeProperties()- Specified by:
isIncludeExchangePropertiesin interfaceorg.apache.camel.spi.BacklogTracer
-
setIncludeExchangeProperties
public void setIncludeExchangeProperties(boolean includeExchangeProperties) - Specified by:
setIncludeExchangePropertiesin interfaceorg.apache.camel.spi.BacklogTracer
-
isIncludeExchangeVariables
public boolean isIncludeExchangeVariables()- Specified by:
isIncludeExchangeVariablesin interfaceorg.apache.camel.spi.BacklogTracer
-
setIncludeExchangeVariables
public void setIncludeExchangeVariables(boolean includeExchangeVariables) - Specified by:
setIncludeExchangeVariablesin interfaceorg.apache.camel.spi.BacklogTracer
-
isIncludeException
public boolean isIncludeException()- Specified by:
isIncludeExceptionin interfaceorg.apache.camel.spi.BacklogTracer
-
setIncludeException
public void setIncludeException(boolean includeException) - Specified by:
setIncludeExceptionin interfaceorg.apache.camel.spi.BacklogTracer
-
isTraceRests
public boolean isTraceRests()- Specified by:
isTraceRestsin interfaceorg.apache.camel.spi.BacklogTracer
-
setTraceRests
public void setTraceRests(boolean traceRests) - Specified by:
setTraceRestsin interfaceorg.apache.camel.spi.BacklogTracer
-
isTraceTemplates
public boolean isTraceTemplates()- Specified by:
isTraceTemplatesin interfaceorg.apache.camel.spi.BacklogTracer
-
setTraceTemplates
public void setTraceTemplates(boolean traceTemplates) - Specified by:
setTraceTemplatesin interfaceorg.apache.camel.spi.BacklogTracer
-
getTracePattern
- Specified by:
getTracePatternin interfaceorg.apache.camel.spi.BacklogTracer
-
setTracePattern
- Specified by:
setTracePatternin interfaceorg.apache.camel.spi.BacklogTracer
-
getTraceFilter
- Specified by:
getTraceFilterin interfaceorg.apache.camel.spi.BacklogTracer
-
setTraceFilter
- Specified by:
setTraceFilterin interfaceorg.apache.camel.spi.BacklogTracer
-
getTraceCounter
public long getTraceCounter()- Specified by:
getTraceCounterin interfaceorg.apache.camel.spi.BacklogTracer
-
getQueueSize
public long getQueueSize()- Specified by:
getQueueSizein interfaceorg.apache.camel.spi.BacklogTracer
-
resetTraceCounter
public void resetTraceCounter()- Specified by:
resetTraceCounterin interfaceorg.apache.camel.spi.BacklogTracer
-
dumpTracedMessages
- Specified by:
dumpTracedMessagesin interfaceorg.apache.camel.spi.BacklogTracer
-
dumpTracedMessagesAsXml
- Specified by:
dumpTracedMessagesAsXmlin interfaceorg.apache.camel.spi.BacklogTracer
-
dumpTracedMessagesAsJSon
- Specified by:
dumpTracedMessagesAsJSonin interfaceorg.apache.camel.spi.BacklogTracer
-
dumpAllTracedMessages
- Specified by:
dumpAllTracedMessagesin interfaceorg.apache.camel.spi.BacklogTracer
-
dumpAllTracedMessagesAsXml
- Specified by:
dumpAllTracedMessagesAsXmlin interfaceorg.apache.camel.spi.BacklogTracer
-
dumpAllTracedMessagesAsJSon
- Specified by:
dumpAllTracedMessagesAsJSonin interfaceorg.apache.camel.spi.BacklogTracer
-
clear
public void clear()- Specified by:
clearin interfaceorg.apache.camel.spi.BacklogTracer
-
incrementTraceCounter
public long incrementTraceCounter() -
doStop
- Overrides:
doStopin classorg.apache.camel.support.service.BaseService- Throws:
Exception
-