Class MetricsMessageHistoryFactory

  • All Implemented Interfaces:
    AutoCloseable, org.apache.camel.CamelContextAware, org.apache.camel.NonManagedService, org.apache.camel.Service, org.apache.camel.ShutdownableService, org.apache.camel.spi.MessageHistoryFactory, org.apache.camel.StatefulService, org.apache.camel.StaticService, org.apache.camel.SuspendableService

    public class MetricsMessageHistoryFactory
    extends org.apache.camel.support.service.ServiceSupport
    implements org.apache.camel.CamelContextAware, org.apache.camel.StaticService, org.apache.camel.NonManagedService, org.apache.camel.spi.MessageHistoryFactory
    A factory to setup and use MetricsMessageHistory as message history implementation.
    • Field Summary

      • Fields 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

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void doInit()  
      org.apache.camel.CamelContext getCamelContext()  
      TimeUnit getDurationUnit()  
      String getJmxDomain()  
      com.codahale.metrics.MetricRegistry getMetricsRegistry()  
      String getNodePattern()  
      TimeUnit getRateUnit()  
      boolean isCopyMessage()  
      boolean isPrettyPrint()  
      boolean isUseJmx()  
      org.apache.camel.MessageHistory newMessageHistory​(String routeId, org.apache.camel.NamedNode node, long timestamp, org.apache.camel.Exchange exchange)  
      void setCamelContext​(org.apache.camel.CamelContext camelContext)  
      void setCopyMessage​(boolean copyMessage)  
      void setDurationUnit​(TimeUnit durationUnit)
      Sets the time unit to use for timing the duration of processing a message in the route
      void setJmxDomain​(String jmxDomain)
      The JMX domain name to use for the enlisted JMX MBeans.
      void setMetricsRegistry​(com.codahale.metrics.MetricRegistry metricsRegistry)
      To use a specific MetricRegistry instance.
      void setNodePattern​(String nodePattern)  
      void setPrettyPrint​(boolean prettyPrint)
      Whether to use pretty print when outputting JSon
      void setRateUnit​(TimeUnit rateUnit)
      Sets the time unit to use for requests per unit (eg requests per second)
      void setUseJmx​(boolean useJmx)
      Whether to use JMX reported to enlist JMX MBeans with the metrics statistics.
      • Methods inherited from class org.apache.camel.support.service.BaseService

        build, doBuild, doFail, doLifecycleChange, doResume, doShutdown, doStart, doStop, doSuspend, fail, getStatus, init, isBuild, isInit, isNew, isRunAllowed, isShutdown, isStarted, isStarting, isStartingOrStarted, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, start, stop, suspend
      • Methods inherited from interface org.apache.camel.Service

        build, close, init, start, stop
      • Methods inherited from interface org.apache.camel.ShutdownableService

        shutdown
      • Methods inherited from interface org.apache.camel.StatefulService

        getStatus, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isSuspending
      • Methods inherited from interface org.apache.camel.SuspendableService

        isSuspended, resume, suspend
    • Constructor Detail

      • MetricsMessageHistoryFactory

        public MetricsMessageHistoryFactory()
    • Method Detail

      • getCamelContext

        public org.apache.camel.CamelContext getCamelContext()
        Specified by:
        getCamelContext in interface org.apache.camel.CamelContextAware
      • setCamelContext

        public void setCamelContext​(org.apache.camel.CamelContext camelContext)
        Specified by:
        setCamelContext in interface org.apache.camel.CamelContextAware
      • getMetricsRegistry

        public com.codahale.metrics.MetricRegistry getMetricsRegistry()
      • setMetricsRegistry

        public void setMetricsRegistry​(com.codahale.metrics.MetricRegistry metricsRegistry)
        To use a specific MetricRegistry instance.

        If no instance has been configured, then Camel will create a shared instance to be used.

      • isUseJmx

        public boolean isUseJmx()
      • setUseJmx

        public void setUseJmx​(boolean useJmx)
        Whether to use JMX reported to enlist JMX MBeans with the metrics statistics.
      • getJmxDomain

        public String getJmxDomain()
      • setJmxDomain

        public void setJmxDomain​(String jmxDomain)
        The JMX domain name to use for the enlisted JMX MBeans.
      • isPrettyPrint

        public boolean isPrettyPrint()
      • setPrettyPrint

        public void setPrettyPrint​(boolean prettyPrint)
        Whether to use pretty print when outputting JSon
      • getRateUnit

        public TimeUnit getRateUnit()
      • setRateUnit

        public void setRateUnit​(TimeUnit rateUnit)
        Sets the time unit to use for requests per unit (eg requests per second)
      • getDurationUnit

        public TimeUnit getDurationUnit()
      • setDurationUnit

        public void setDurationUnit​(TimeUnit durationUnit)
        Sets the time unit to use for timing the duration of processing a message in the route
      • isCopyMessage

        public boolean isCopyMessage()
        Specified by:
        isCopyMessage in interface org.apache.camel.spi.MessageHistoryFactory
      • setCopyMessage

        public void setCopyMessage​(boolean copyMessage)
        Specified by:
        setCopyMessage in interface org.apache.camel.spi.MessageHistoryFactory
      • getNodePattern

        public String getNodePattern()
        Specified by:
        getNodePattern in interface org.apache.camel.spi.MessageHistoryFactory
      • setNodePattern

        public void setNodePattern​(String nodePattern)
        Specified by:
        setNodePattern in interface org.apache.camel.spi.MessageHistoryFactory
      • newMessageHistory

        public org.apache.camel.MessageHistory newMessageHistory​(String routeId,
                                                                 org.apache.camel.NamedNode node,
                                                                 long timestamp,
                                                                 org.apache.camel.Exchange exchange)
        Specified by:
        newMessageHistory in interface org.apache.camel.spi.MessageHistoryFactory
      • doInit

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