Class BacklogTracer

  • All Implemented Interfaces:
    AutoCloseable, org.apache.camel.Service, org.apache.camel.ShutdownableService, org.apache.camel.StatefulService, org.apache.camel.SuspendableService

    public final class BacklogTracer
    extends org.apache.camel.support.service.ServiceSupport
    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.

    • Method Detail

      • createTracer

        public static BacklogTracer createTracer​(org.apache.camel.CamelContext context)
        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 definition
        exchange - the exchange
        Returns:
        true to trace, false to skip tracing
      • isEnabled

        public boolean isEnabled()
      • setEnabled

        public void setEnabled​(boolean enabled)
      • getBacklogSize

        public int getBacklogSize()
      • setBacklogSize

        public void setBacklogSize​(int backlogSize)
      • isRemoveOnDump

        public boolean isRemoveOnDump()
      • setRemoveOnDump

        public void setRemoveOnDump​(boolean removeOnDump)
      • getBodyMaxChars

        public int getBodyMaxChars()
      • setBodyMaxChars

        public void setBodyMaxChars​(int bodyMaxChars)
      • isBodyIncludeStreams

        public boolean isBodyIncludeStreams()
      • setBodyIncludeStreams

        public void setBodyIncludeStreams​(boolean bodyIncludeStreams)
      • isBodyIncludeFiles

        public boolean isBodyIncludeFiles()
      • setBodyIncludeFiles

        public void setBodyIncludeFiles​(boolean bodyIncludeFiles)
      • getTracePattern

        public String getTracePattern()
      • setTracePattern

        public void setTracePattern​(String tracePattern)
      • getTraceFilter

        public String getTraceFilter()
      • setTraceFilter

        public void setTraceFilter​(String filter)
      • getTraceCounter

        public long getTraceCounter()
      • resetTraceCounter

        public void resetTraceCounter()
      • dumpTracedMessages

        public List<org.apache.camel.api.management.mbean.BacklogTracerEventMessage> dumpTracedMessages​(String nodeId)
      • dumpTracedMessagesAsXml

        public String dumpTracedMessagesAsXml​(String nodeId)
      • dumpAllTracedMessages

        public List<org.apache.camel.api.management.mbean.BacklogTracerEventMessage> dumpAllTracedMessages()
      • dumpAllTracedMessagesAsXml

        public String dumpAllTracedMessagesAsXml()
      • clear

        public void clear()
      • incrementTraceCounter

        public long incrementTraceCounter()
      • doStart

        protected void doStart()
                        throws Exception
        Overrides:
        doStart in class org.apache.camel.support.service.BaseService
        Throws:
        Exception
      • doStop

        protected void doStop()
                       throws Exception
        Overrides:
        doStop in class org.apache.camel.support.service.BaseService
        Throws:
        Exception