Class MicrometerMessageHistoryFactory

  • 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 MicrometerMessageHistoryFactory
    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 MicrometerMessageHistory 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
    • Constructor Detail

      • MicrometerMessageHistoryFactory

        public MicrometerMessageHistoryFactory()
    • 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
      • getMeterRegistry

        public io.micrometer.core.instrument.MeterRegistry getMeterRegistry()
      • setMeterRegistry

        public void setMeterRegistry​(io.micrometer.core.instrument.MeterRegistry meterRegistry)
        To use a specific MeterRegistry instance.

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

      • isPrettyPrint

        public boolean isPrettyPrint()
      • setPrettyPrint

        public void setPrettyPrint​(boolean prettyPrint)
        Whether to use pretty print when outputting JSon
      • 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 namedNode,
                                                                 long timestamp,
                                                                 org.apache.camel.Exchange exchange)
        Specified by:
        newMessageHistory in interface org.apache.camel.spi.MessageHistoryFactory
      • doStart

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

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