Class MicrometerRoutePolicyFactory
java.lang.Object
org.apache.camel.support.service.BaseService
org.apache.camel.support.service.ServiceSupport
org.apache.camel.component.micrometer.routepolicy.MicrometerRoutePolicyFactory
- 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.RoutePolicyFactory,org.apache.camel.StatefulService,org.apache.camel.StaticService,org.apache.camel.SuspendableService
public class MicrometerRoutePolicyFactory
extends org.apache.camel.support.service.ServiceSupport
implements org.apache.camel.spi.RoutePolicyFactory, org.apache.camel.CamelContextAware, org.apache.camel.NonManagedService, org.apache.camel.StaticService
A
RoutePolicyFactory to plugin and use metrics for gathering route utilization
statistics-
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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.camel.spi.RoutePolicycreateRoutePolicy(org.apache.camel.CamelContext camelContext, String routeId, org.apache.camel.NamedNode routeDefinition) protected voidorg.apache.camel.CamelContextSets the time unit to use for requests per unit (eg requests per second)io.micrometer.core.instrument.MeterRegistrybooleanbooleanvoidsetCamelContext(org.apache.camel.CamelContext camelContext) 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(MicrometerRoutePolicyNamingStrategy namingStrategy) voidsetPolicyConfiguration(MicrometerRoutePolicyConfiguration policyConfiguration) voidsetPrettyPrint(boolean prettyPrint) Whether to use pretty print when outputting JSonvoidsetSkipCamelInfo(boolean skipCamelInfo) Skip the evaluation of "app.info" metric which contains runtime provider information (default, `false`).Methods inherited from class org.apache.camel.support.service.BaseService
build, doBuild, doFail, doInit, doLifecycleChange, doResume, doStart, doStop, doSuspend, fail, getInternalLock, getStatus, init, isBuild, isInit, isNew, isRunAllowed, isShutdown, isStarted, isStarting, isStartingOrStarted, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, start, stop, suspendMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.camel.Service
build, close, init, start, stopMethods inherited from interface org.apache.camel.ShutdownableService
shutdownMethods inherited from interface org.apache.camel.StatefulService
getStatus, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isSuspendingMethods inherited from interface org.apache.camel.SuspendableService
isSuspended, resume, suspend
-
Constructor Details
-
MicrometerRoutePolicyFactory
public MicrometerRoutePolicyFactory()
-
-
Method Details
-
getCamelContext
public org.apache.camel.CamelContext getCamelContext()- Specified by:
getCamelContextin interfaceorg.apache.camel.spi.HasCamelContext
-
setCamelContext
public void setCamelContext(org.apache.camel.CamelContext camelContext) - Specified by:
setCamelContextin interfaceorg.apache.camel.CamelContextAware
-
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. -
getMeterRegistry
public io.micrometer.core.instrument.MeterRegistry getMeterRegistry() -
isPrettyPrint
public boolean isPrettyPrint() -
setPrettyPrint
public void setPrettyPrint(boolean prettyPrint) Whether to use pretty print when outputting JSon -
isSkipCamelInfo
public boolean isSkipCamelInfo() -
setSkipCamelInfo
public void setSkipCamelInfo(boolean skipCamelInfo) Skip the evaluation of "app.info" metric which contains runtime provider information (default, `false`). -
getDurationUnit
Sets the time unit to use for requests per unit (eg requests per second) -
setDurationUnit
Sets the time unit to use for timing the duration of processing a message in the route -
getNamingStrategy
-
setNamingStrategy
-
getPolicyConfiguration
-
setPolicyConfiguration
-
createOrGetContextMetric
-
createRoutePolicy
public org.apache.camel.spi.RoutePolicy createRoutePolicy(org.apache.camel.CamelContext camelContext, String routeId, org.apache.camel.NamedNode routeDefinition) - Specified by:
createRoutePolicyin interfaceorg.apache.camel.spi.RoutePolicyFactory
-
doShutdown
- Overrides:
doShutdownin classorg.apache.camel.support.service.BaseService- Throws:
Exception
-