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.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.MessageHistoryFactoryA factory to setup and useMicrometerMessageHistoryas message history implementation.
-
-
Constructor Summary
Constructors Constructor Description MicrometerMessageHistoryFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voiddoStart()protected voiddoStop()org.apache.camel.CamelContextgetCamelContext()TimeUnitgetDurationUnit()io.micrometer.core.instrument.MeterRegistrygetMeterRegistry()MicrometerMessageHistoryNamingStrategygetNamingStrategy()StringgetNodePattern()booleanisCopyMessage()booleanisPrettyPrint()org.apache.camel.MessageHistorynewMessageHistory(String routeId, org.apache.camel.NamedNode namedNode, long timestamp, org.apache.camel.Exchange exchange)voidsetCamelContext(org.apache.camel.CamelContext camelContext)voidsetCopyMessage(boolean copyMessage)voidsetDurationUnit(TimeUnit durationUnit)Sets the time unit to use for timing the duration of processing a message in the routevoidsetMeterRegistry(io.micrometer.core.instrument.MeterRegistry meterRegistry)To use a specificMeterRegistryinstance.voidsetNamingStrategy(MicrometerMessageHistoryNamingStrategy namingStrategy)Sets the naming strategy for message history meter namesvoidsetNodePattern(String nodePattern)voidsetPrettyPrint(boolean prettyPrint)Whether to use pretty print when outputting JSon-
Methods 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
-
-
-
-
Method Detail
-
getCamelContext
public org.apache.camel.CamelContext getCamelContext()
- Specified by:
getCamelContextin interfaceorg.apache.camel.CamelContextAware
-
setCamelContext
public void setCamelContext(org.apache.camel.CamelContext camelContext)
- Specified by:
setCamelContextin 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 specificMeterRegistryinstance. 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
-
getNamingStrategy
public MicrometerMessageHistoryNamingStrategy getNamingStrategy()
-
setNamingStrategy
public void setNamingStrategy(MicrometerMessageHistoryNamingStrategy namingStrategy)
Sets the naming strategy for message history meter names
-
isCopyMessage
public boolean isCopyMessage()
- Specified by:
isCopyMessagein interfaceorg.apache.camel.spi.MessageHistoryFactory
-
setCopyMessage
public void setCopyMessage(boolean copyMessage)
- Specified by:
setCopyMessagein interfaceorg.apache.camel.spi.MessageHistoryFactory
-
getNodePattern
public String getNodePattern()
- Specified by:
getNodePatternin interfaceorg.apache.camel.spi.MessageHistoryFactory
-
setNodePattern
public void setNodePattern(String nodePattern)
- Specified by:
setNodePatternin 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:
newMessageHistoryin interfaceorg.apache.camel.spi.MessageHistoryFactory
-
doStart
protected void doStart() throws Exception- Overrides:
doStartin classorg.apache.camel.support.service.BaseService- Throws:
Exception
-
doStop
protected void doStop()
- Overrides:
doStopin classorg.apache.camel.support.service.BaseService
-
-