Class MicrometerMessageHistoryFactory
java.lang.Object
org.apache.camel.support.service.BaseService
org.apache.camel.support.service.ServiceSupport
org.apache.camel.component.micrometer.messagehistory.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.HasCamelContext
,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 Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
doStart()
protected void
doStop()
org.apache.camel.CamelContext
io.micrometer.core.instrument.MeterRegistry
boolean
boolean
org.apache.camel.MessageHistory
newMessageHistory
(String routeId, org.apache.camel.NamedNode namedNode, 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 routevoid
setMeterRegistry
(io.micrometer.core.instrument.MeterRegistry meterRegistry) To use a specificMeterRegistry
instance.void
setNamingStrategy
(MicrometerMessageHistoryNamingStrategy namingStrategy) Sets the naming strategy for message history meter namesvoid
setNodePattern
(String nodePattern) void
setPrettyPrint
(boolean prettyPrint) Whether to use pretty print when outputting JSonMethods inherited from class org.apache.camel.support.service.BaseService
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
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
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 Details
-
MicrometerMessageHistoryFactory
public MicrometerMessageHistoryFactory()
-
-
Method Details
-
getCamelContext
public org.apache.camel.CamelContext getCamelContext()- Specified by:
getCamelContext
in interfaceorg.apache.camel.spi.HasCamelContext
-
setCamelContext
public void setCamelContext(org.apache.camel.CamelContext camelContext) - Specified by:
setCamelContext
in interfaceorg.apache.camel.CamelContextAware
-
getMeterRegistry
public io.micrometer.core.instrument.MeterRegistry getMeterRegistry() -
setMeterRegistry
public void setMeterRegistry(io.micrometer.core.instrument.MeterRegistry meterRegistry) To use a specificMeterRegistry
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
-
setDurationUnit
Sets the time unit to use for timing the duration of processing a message in the route -
getNamingStrategy
-
setNamingStrategy
Sets the naming strategy for message history meter names -
isCopyMessage
public boolean isCopyMessage()- Specified by:
isCopyMessage
in interfaceorg.apache.camel.spi.MessageHistoryFactory
-
setCopyMessage
public void setCopyMessage(boolean copyMessage) - Specified by:
setCopyMessage
in interfaceorg.apache.camel.spi.MessageHistoryFactory
-
getNodePattern
- Specified by:
getNodePattern
in interfaceorg.apache.camel.spi.MessageHistoryFactory
-
setNodePattern
- Specified by:
setNodePattern
in interfaceorg.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 interfaceorg.apache.camel.spi.MessageHistoryFactory
-
doStart
- Overrides:
doStart
in classorg.apache.camel.support.service.BaseService
- Throws:
Exception
-
doStop
protected void doStop()- Overrides:
doStop
in classorg.apache.camel.support.service.BaseService
-