public interface CamelContext extends SuspendableService, RuntimeConfiguration
start()
- to start (important: the start method is not blocked, see more details
here)stop()
- to shutdown (will stop all routes/components/endpoints etc and clear internal state/cache)SuspendableService.suspend()
- to pause routing messagesSuspendableService.resume()
- to resume after a suspendstop()
and SuspendableService.suspend()
will gracefully stop/suspend routes ensuring any messages
in progress will be given time to complete. See more details at ShutdownStrategy
.
If you are doing a hot restart then it's advised to use the suspend/resume methods which ensure a faster
restart but also allows any internal state to be kept as is.
The stop/start approach will do a cold restart of Camel, where all internal state is reset.
End users are advised to use suspend/resume. Using stop is for shutting down Camel and it's not guaranteed that
when it's being started again using the start method that Camel will operate consistently.Modifier and Type | Method and Description |
---|---|
<T extends CamelContext> |
adapt(Class<T> type)
Adapts this
CamelContext to the specialized type. |
void |
addComponent(String componentName,
Component component)
Adds a component to the context.
|
Endpoint |
addEndpoint(String uri,
Endpoint endpoint)
Adds the endpoint to the
EndpointRegistry using the given URI. |
void |
addHystrixConfiguration(String id,
HystrixConfigurationDefinition configuration)
Adds the Hystrix configuration
|
void |
addInterceptStrategy(InterceptStrategy interceptStrategy)
Adds the given interceptor strategy
|
void |
addLifecycleStrategy(LifecycleStrategy lifecycleStrategy)
Adds the given lifecycle strategy to be used.
|
void |
addLogListener(LogListener listener)
Adds a
LogListener . |
void |
addRegisterEndpointCallback(EndpointStrategy strategy)
Registers a
callback to allow you to do custom
logic when an Endpoint is about to be registered to the EndpointRegistry . |
void |
addRestConfiguration(RestConfiguration restConfiguration)
Sets a custom
RestConfiguration |
void |
addRestDefinitions(Collection<RestDefinition> restDefinitions)
Adds a collection of rest definitions to the context
|
void |
addRouteDefinition(RouteDefinition routeDefinition)
Add a route definition to the context
|
void |
addRouteDefinitions(Collection<RouteDefinition> routeDefinitions)
Adds a collection of route definitions to the context
|
void |
addRoutePolicyFactory(RoutePolicyFactory routePolicyFactory)
Adds the given route policy factory
|
void |
addRoutes(RoutesBuilder builder)
Adds a collection of routes to this CamelContext using the given builder
to build them.
|
void |
addService(Object object)
Adds a service to this CamelContext, which allows this CamelContext to control the lifecycle, ensuring
the service is stopped when the CamelContext stops.
|
void |
addService(Object object,
boolean stopOnShutdown)
Adds a service to this CamelContext.
|
void |
addService(Object object,
boolean stopOnShutdown,
boolean forceStart)
Adds a service to this CamelContext.
|
void |
addServiceCallConfiguration(String serviceName,
ServiceCallConfigurationDefinition configuration)
Adds the service call configuration
|
void |
addStartupListener(StartupListener listener)
Adds the given listener to be invoked when
CamelContext have just been started. |
ConsumerTemplate |
createConsumerTemplate()
Creates a new
ConsumerTemplate which is started and therefore ready to use right away. |
ConsumerTemplate |
createConsumerTemplate(int maximumCacheSize)
Creates a new
ConsumerTemplate which is started and therefore ready to use right away. |
DataFormat |
createDataFormat(String name)
Creates the given data format given its name.
|
FluentProducerTemplate |
createFluentProducerTemplate()
Creates a new
FluentProducerTemplate which is started and therefore ready to use right away. |
FluentProducerTemplate |
createFluentProducerTemplate(int maximumCacheSize)
Creates a new
FluentProducerTemplate which is started and therefore ready to use right away. |
ProducerTemplate |
createProducerTemplate()
Creates a new
ProducerTemplate which is started and therefore ready to use right away. |
ProducerTemplate |
createProducerTemplate(int maximumCacheSize)
Creates a new
ProducerTemplate which is started and therefore ready to use right away. |
String |
createRouteStaticEndpointJson(String routeId)
Creates a JSON representation of all the static and dynamic configured endpoints defined in the given route(s).
|
String |
createRouteStaticEndpointJson(String routeId,
boolean includeDynamic)
Creates a JSON representation of all the static (and possible dynamic) configured endpoints defined in the given route(s).
|
void |
deferStartService(Object object,
boolean stopOnShutdown)
Defers starting the service until
CamelContext is (almost started) or started and has initialized all its prior services and routes. |
void |
disableJMX()
Disables using JMX as
ManagementStrategy . |
String |
explainComponentJson(String componentName,
boolean includeAllOptions)
Returns a JSON schema representation of the component parameters (not endpoint parameters) for the given component by its id.
|
String |
explainDataFormatJson(String dataFormatName,
DataFormat dataFormat,
boolean includeAllOptions)
Returns a JSON schema representation of the component parameters (not endpoint parameters) for the given component by its id.
|
String |
explainEipJson(String nameOrId,
boolean includeAllOptions)
Returns a JSON schema representation of the EIP parameters for the given EIP by its id.
|
String |
explainEndpointJson(String uri,
boolean includeAllOptions)
Returns a JSON schema representation of the endpoint parameters for the given endpoint uri.
|
Map<String,Properties> |
findComponents()
Find information about all the Camel components available in the classpath and
Registry . |
Map<String,Properties> |
findEips()
Find information about all the EIPs from camel-core.
|
ClassLoader |
getApplicationContextClassLoader()
Gets the application CamelContext class loader which may be helpful for running camel in other containers
|
AsyncProcessorAwaitManager |
getAsyncProcessorAwaitManager()
Gets the
AsyncProcessor await manager. |
ClassResolver |
getClassResolver()
Returns the class resolver to be used for loading/lookup of classes.
|
Component |
getComponent(String componentName)
Gets a component from the CamelContext by name.
|
Component |
getComponent(String name,
boolean autoCreateComponents)
Gets a component from the CamelContext by name.
|
Component |
getComponent(String name,
boolean autoCreateComponents,
boolean autoStart)
Gets a component from the CamelContext by name.
|
<T extends Component> |
getComponent(String name,
Class<T> componentType)
Gets a component from the CamelContext by name and specifying the expected type of component.
|
String |
getComponentDocumentation(String componentName)
Deprecated.
use camel-catalog instead
|
List<String> |
getComponentNames()
Gets a readonly list of names of the components currently registered
|
String |
getComponentParameterJsonSchema(String componentName)
Returns the JSON schema representation of the component and endpoint parameters for the given component name.
|
String |
getDataFormatParameterJsonSchema(String dataFormatName)
Returns the JSON schema representation of the
DataFormat parameters for the given data format name. |
DataFormatResolver |
getDataFormatResolver()
Gets the current data format resolver
|
Map<String,DataFormatDefinition> |
getDataFormats()
Gets the data formats that can be referenced in the routes.
|
Debugger |
getDebugger()
Gets the current
Debugger |
InterceptStrategy |
getDefaultBacklogDebugger()
Gets the default backlog debugger
|
InterceptStrategy |
getDefaultBacklogTracer()
Gets the default backlog tracer
|
FactoryFinder |
getDefaultFactoryFinder()
Gets the default FactoryFinder which will be used for the loading the factory class from META-INF
|
InterceptStrategy |
getDefaultTracer()
Gets the default tracer
|
String |
getEipParameterJsonSchema(String eipName)
Returns the JSON schema representation of the EIP parameters for the given EIP name.
|
Endpoint |
getEndpoint(String uri)
Resolves the given name to an
Endpoint of the specified type. |
<T extends Endpoint> |
getEndpoint(String name,
Class<T> endpointType)
Resolves the given name to an
Endpoint of the specified type. |
Map<String,Endpoint> |
getEndpointMap()
Returns a new
Map containing all of the endpoints from the EndpointRegistry |
EndpointRegistry<String> |
getEndpointRegistry()
Gets the
EndpointRegistry |
Collection<Endpoint> |
getEndpoints()
Returns a new
Collection of all of the endpoints from the EndpointRegistry |
ErrorHandlerBuilder |
getErrorHandlerBuilder()
Deprecated.
The return type will be switched to
ErrorHandlerFactory in Camel 3.0 |
ScheduledExecutorService |
getErrorHandlerExecutorService()
Gets the default shared thread pool for error handlers which
leverages this for asynchronous redelivery tasks.
|
ExecutorServiceManager |
getExecutorServiceManager()
Gets the current
ExecutorServiceManager |
ExecutorServiceStrategy |
getExecutorServiceStrategy()
Deprecated.
|
FactoryFinder |
getFactoryFinder(String path)
Gets the FactoryFinder which will be used for the loading the factory class from META-INF in the given path
|
String |
getGlobalOption(String key)
Gets the global option value that can be referenced in the camel context
Important: This has nothing to do with property placeholders, and is just a plain set of key/value pairs
which are used to configure global options on CamelContext, such as a maximum debug logging length etc.
|
Map<String,String> |
getGlobalOptions()
Gets global options that can be referenced in the camel context.
|
HeadersMapFactory |
getHeadersMapFactory()
Gets the
HeadersMapFactory to use. |
HealthCheckRegistry |
getHealthCheckRegistry()
Returns an optional
HealthCheckRegistry , by default no registry is
present and it must be explicit activated. |
HystrixConfigurationDefinition |
getHystrixConfiguration(String id)
Gets the Hystrix configuration by the given name.
|
InflightRepository |
getInflightRepository()
Gets the inflight repository
|
Injector |
getInjector()
Returns the injector used to instantiate objects by type
|
List<InterceptStrategy> |
getInterceptStrategies()
Gets the interceptor strategies
|
List<String> |
getLanguageNames()
Gets a readonly list with the names of the languages currently registered.
|
String |
getLanguageParameterJsonSchema(String languageName)
Returns the JSON schema representation of the
Language parameters for the given language name. |
List<LifecycleStrategy> |
getLifecycleStrategies()
Returns the lifecycle strategies used to handle lifecycle notifications
|
Set<LogListener> |
getLogListeners()
Gets a list of
LogListener . |
ManagedCamelContextMBean |
getManagedCamelContext()
Gets the managed Camel CamelContext client api
|
<T extends ManagedProcessorMBean> |
getManagedProcessor(String id,
Class<T> type)
Gets the managed processor client api from any of the routes which with the given id
|
<T extends ManagedRouteMBean> |
getManagedRoute(String routeId,
Class<T> type)
Gets the managed route client api with the given route id
|
ManagementMBeanAssembler |
getManagementMBeanAssembler()
Returns the management mbean assembler
|
String |
getManagementName()
Gets the name this
CamelContext was registered in JMX. |
ManagementNameStrategy |
getManagementNameStrategy()
Gets the current management name strategy
|
ManagementStrategy |
getManagementStrategy()
Gets the management strategy
|
MessageHistoryFactory |
getMessageHistoryFactory()
Gets the current
MessageHistoryFactory |
ModelJAXBContextFactory |
getModelJAXBContextFactory()
Returns the JAXB Context factory used to create Models.
|
String |
getName()
Gets the name (id) of the this CamelContext.
|
CamelContextNameStrategy |
getNameStrategy()
Gets the current name strategy
|
NodeIdFactory |
getNodeIdFactory()
Gets the node id factory
|
PackageScanClassResolver |
getPackageScanClassResolver()
Returns the package scanning class resolver
|
ServicePool<Endpoint,PollingConsumer> |
getPollingConsumerServicePool()
Gets the service pool for
Producer pooling. |
Processor |
getProcessor(String id)
Gets the processor from any of the routes which with the given id
|
<T extends Processor> |
getProcessor(String id,
Class<T> type)
Gets the processor from any of the routes which with the given id
|
ProcessorDefinition |
getProcessorDefinition(String id)
Gets the processor definition from any of the routes which with the given id
|
<T extends ProcessorDefinition> |
getProcessorDefinition(String id,
Class<T> type)
Gets the processor definition from any of the routes which with the given id
|
ProcessorFactory |
getProcessorFactory()
Gets the current
ProcessorFactory |
ServicePool<Endpoint,Producer> |
getProducerServicePool()
Gets the service pool for
Producer pooling. |
Map<String,String> |
getProperties()
Deprecated.
use
getGlobalOptions() instead. |
String |
getProperty(String key)
Deprecated.
use
getGlobalOption(String) instead. |
String |
getPropertyPrefixToken()
Returns the configured property placeholder prefix token if and only if the CamelContext has
property placeholder abilities, otherwise returns
null . |
String |
getPropertySuffixToken()
Returns the configured property placeholder suffix token if and only if the CamelContext has
property placeholder abilities, otherwise returns
null . |
Registry |
getRegistry()
Returns the registry used to lookup components by name and type such as the Spring ApplicationContext,
JNDI or the OSGi Service Registry
|
<T> T |
getRegistry(Class<T> type)
Returns the registry used to lookup components by name and as the given type
|
ReloadStrategy |
getReloadStrategy()
Returns the
ReloadStrategy if in use. |
RestConfiguration |
getRestConfiguration()
Gets the default REST configuration
|
RestConfiguration |
getRestConfiguration(String component,
boolean defaultIfNotFound)
Gets the REST configuration for the given component
|
Collection<RestConfiguration> |
getRestConfigurations()
Gets all the RestConfiguration's
|
List<RestDefinition> |
getRestDefinitions()
Returns a list of the current REST definitions
|
RestRegistry |
getRestRegistry()
Gets the
RestRegistry to use |
Route |
getRoute(String id)
Gets the route with the given id
|
RouteController |
getRouteController()
NOTE: experimental api
|
RouteDefinition |
getRouteDefinition(String id)
Gets the route definition with the given id
|
List<RouteDefinition> |
getRouteDefinitions()
Returns a list of the current route definitions
|
List<RoutePolicyFactory> |
getRoutePolicyFactories()
Gets the route policy factories
|
List<Route> |
getRoutes()
Returns the current routes in this CamelContext
|
List<RouteStartupOrder> |
getRouteStartupOrder()
Returns the order in which the route inputs was started.
|
ServiceStatus |
getRouteStatus(String routeId)
Returns the current status of the given route
|
RuntimeCamelCatalog |
getRuntimeCamelCatalog()
Gets the associated
RuntimeCamelCatalog for this CamelContext. |
RuntimeEndpointRegistry |
getRuntimeEndpointRegistry()
Gets the
RuntimeEndpointRegistry to use, or null if none is in use. |
ServiceCallConfigurationDefinition |
getServiceCallConfiguration(String serviceName)
Gets the service call configuration by the given name.
|
ShutdownStrategy |
getShutdownStrategy()
Gets the current shutdown strategy
|
SSLContextParameters |
getSSLContextParameters()
Gets the global SSL context parameters if configured.
|
ServiceStatus |
getStatus()
Get the status of this CamelContext
|
StreamCachingStrategy |
getStreamCachingStrategy()
Gets the
StreamCachingStrategy to use. |
TransformerRegistry |
getTransformerRegistry()
Gets the
TransformerRegistry |
List<TransformerDefinition> |
getTransformers()
Gets the transformers that can be referenced in the routes.
|
TypeConverter |
getTypeConverter()
Returns the type converter used to coerce types from one type to another
|
TypeConverterRegistry |
getTypeConverterRegistry()
Returns the type converter registry where type converters can be added or looked up
|
UnitOfWorkFactory |
getUnitOfWorkFactory()
Gets the
UnitOfWorkFactory to use. |
String |
getUptime()
Gets the uptime in a human readable format
|
long |
getUptimeMillis()
Gets the uptime in milli seconds
|
UuidGenerator |
getUuidGenerator()
Gets the current
UuidGenerator |
ValidatorRegistry |
getValidatorRegistry()
Gets the
ValidatorRegistry |
List<ValidatorDefinition> |
getValidators()
Gets the validators that can be referenced in the routes.
|
String |
getVersion()
Gets the version of the this CamelContext.
|
Component |
hasComponent(String componentName)
Is the given component already registered?
|
Endpoint |
hasEndpoint(String uri)
Is the given endpoint already registered in the
EndpointRegistry |
<T> T |
hasService(Class<T> type)
Has the given service type already been added to this CamelContext?
|
boolean |
hasService(Object object)
Has the given service already been added to this CamelContext?
|
<T> Set<T> |
hasServices(Class<T> type)
Has the given service type already been added to this CamelContext?
|
Boolean |
isLazyLoadTypeConverters()
Deprecated.
this option is no longer supported, will be removed in a future Camel release.
|
Boolean |
isLoadTypeConverters()
Sets whether to load custom type converters by scanning classpath.
|
boolean |
isSetupRoutes()
Indicates whether current thread is setting up route(s) as part of starting Camel from spring/blueprint.
|
boolean |
isStartingRoutes()
Indicates whether current thread is starting route(s).
|
Boolean |
isTypeConverterStatisticsEnabled()
Whether or not type converter statistics is enabled.
|
Boolean |
isUseBreadcrumb()
Whether or not breadcrumb is enabled.
|
Boolean |
isUseDataType()
Whether to enable using data type on Camel messages.
|
Boolean |
isUseMDCLogging()
Whether or not MDC logging is being enabled.
|
boolean |
isVetoStarted()
If CamelContext during the start procedure was vetoed, and therefore causing Camel to not start.
|
RestsDefinition |
loadRestsDefinition(InputStream is)
Loads a collection of rest definitions from the given
InputStream . |
RoutesDefinition |
loadRoutesDefinition(InputStream is)
Loads a collection of route definitions from the given
InputStream . |
Component |
removeComponent(String componentName)
Removes a previously added component.
|
void |
removeEndpoint(Endpoint endpoint)
Removes the endpoint from the
EndpointRegistry . |
Collection<Endpoint> |
removeEndpoints(String pattern)
Removes all endpoints with the given URI from the
EndpointRegistry . |
boolean |
removeRoute(String routeId)
Removes the given route (the route must be stopped before it can be removed).
|
void |
removeRouteDefinition(RouteDefinition routeDefinition)
Removes a route definition from the CamelContext - stopping any previously running
routes if any of them are actively running
|
void |
removeRouteDefinitions(Collection<RouteDefinition> routeDefinitions)
Removes a collection of route definitions from the CamelContext - stopping any previously running
routes if any of them are actively running
|
boolean |
removeService(Object object)
Removes a service from this CamelContext.
|
String |
resolveComponentDefaultName(String javaType)
Resolves a component's default name from its java type.
|
DataFormat |
resolveDataFormat(String name)
Resolve a data format given its name
|
DataFormatDefinition |
resolveDataFormatDefinition(String name)
Resolve a data format definition given its name
|
Language |
resolveLanguage(String language)
Resolves a language for creating expressions
|
String |
resolvePropertyPlaceholders(String text)
Parses the given text and resolve any property placeholders - using {{key}}.
|
Transformer |
resolveTransformer(DataType from,
DataType to)
Resolve a transformer given from/to data type.
|
Transformer |
resolveTransformer(String model)
Resolve a transformer given a scheme
|
Validator |
resolveValidator(DataType type)
Resolve a validator given from/to data type.
|
void |
resumeRoute(String routeId)
Resumes the given route if it has been previously suspended
If the route does not support suspension the route will be started instead
|
void |
setApplicationContextClassLoader(ClassLoader classLoader)
Sets the application CamelContext class loader
|
void |
setAsyncProcessorAwaitManager(AsyncProcessorAwaitManager manager)
Sets a custom
AsyncProcessor await manager. |
void |
setClassResolver(ClassResolver resolver)
Sets the class resolver to be use
|
void |
setDataFormatResolver(DataFormatResolver dataFormatResolver)
Sets a custom data format resolver
|
void |
setDataFormats(Map<String,DataFormatDefinition> dataFormats)
Sets the data formats that can be referenced in the routes.
|
void |
setDebugger(Debugger debugger)
Sets a custom
Debugger |
void |
setDefaultBacklogDebugger(InterceptStrategy backlogDebugger)
Sets a custom backlog debugger to be used as the default backlog debugger.
|
void |
setDefaultBacklogTracer(InterceptStrategy backlogTracer)
Sets a custom backlog tracer to be used as the default backlog tracer.
|
void |
setDefaultTracer(InterceptStrategy tracer)
Sets a custom tracer to be used as the default tracer.
|
void |
setErrorHandlerBuilder(ErrorHandlerFactory errorHandlerBuilder)
Sets the default error handler builder which is inherited by the routes
|
void |
setExecutorServiceManager(ExecutorServiceManager executorServiceManager)
Sets a custom
ExecutorServiceManager |
void |
setFactoryFinderResolver(FactoryFinderResolver resolver)
Sets the factory finder resolver to use.
|
void |
setGlobalOptions(Map<String,String> globalOptions)
Sets global options that can be referenced in the camel context
Important: This has nothing to do with property placeholders, and is just a plain set of key/value pairs
which are used to configure global options on CamelContext, such as a maximum debug logging length etc.
|
void |
setHeadersMapFactory(HeadersMapFactory factory)
Sets a custom
HeadersMapFactory to be used. |
void |
setHealthCheckRegistry(HealthCheckRegistry healthCheckRegistry)
Sets a
HealthCheckRegistry . |
void |
setHystrixConfiguration(HystrixConfigurationDefinition configuration)
Sets the default Hystrix configuration
|
void |
setHystrixConfigurations(List<HystrixConfigurationDefinition> configurations)
Sets the Hystrix configurations
|
void |
setInflightRepository(InflightRepository repository)
Sets a custom inflight repository to use
|
void |
setLazyLoadTypeConverters(Boolean lazyLoadTypeConverters)
Deprecated.
this option is no longer supported, will be removed in a future Camel release.
|
void |
setLoadTypeConverters(Boolean loadTypeConverters)
Sets whether to load custom type converters by scanning classpath.
|
void |
setManagementNameStrategy(ManagementNameStrategy nameStrategy)
Sets a custom management name strategy
|
void |
setManagementStrategy(ManagementStrategy strategy)
Sets the management strategy to use
|
void |
setMessageHistoryFactory(MessageHistoryFactory messageHistoryFactory)
Sets a custom
MessageHistoryFactory |
void |
setModelJAXBContextFactory(ModelJAXBContextFactory modelJAXBContextFactory)
Sets a custom JAXB Context factory to be used
|
void |
setNameStrategy(CamelContextNameStrategy nameStrategy)
Sets a custom name strategy
|
void |
setNodeIdFactory(NodeIdFactory factory)
Uses a custom node id factory when generating auto assigned ids to the nodes in the route definitions
|
void |
setPackageScanClassResolver(PackageScanClassResolver resolver)
Sets the package scanning class resolver to use
|
void |
setPollingConsumerServicePool(ServicePool<Endpoint,PollingConsumer> servicePool)
Sets a pluggable service pool to use for
PollingConsumer pooling. |
void |
setProcessorFactory(ProcessorFactory processorFactory)
Sets a custom
ProcessorFactory |
void |
setProducerServicePool(ServicePool<Endpoint,Producer> servicePool)
Sets a pluggable service pool to use for
Producer pooling. |
void |
setProperties(Map<String,String> properties)
Deprecated.
|
void |
setReloadStrategy(ReloadStrategy reloadStrategy)
Sets a custom
ReloadStrategy to be used |
void |
setRestConfiguration(RestConfiguration restConfiguration)
Sets a custom
RestConfiguration |
void |
setRestRegistry(RestRegistry restRegistry)
Sets a custom
RestRegistry to use. |
void |
setRouteController(RouteController routeController)
NOTE: experimental api
|
void |
setRuntimeEndpointRegistry(RuntimeEndpointRegistry runtimeEndpointRegistry)
Sets a custom
RuntimeEndpointRegistry to use. |
void |
setServiceCallConfiguration(ServiceCallConfigurationDefinition configuration)
Sets the default service call configuration
|
void |
setServiceCallConfigurations(List<ServiceCallConfigurationDefinition> configurations)
Sets the service call configurations
|
void |
setShutdownStrategy(ShutdownStrategy shutdownStrategy)
Sets a custom shutdown strategy
|
void |
setSSLContextParameters(SSLContextParameters sslContextParameters)
Sets the global SSL context parameters.
|
void |
setStreamCachingStrategy(StreamCachingStrategy streamCachingStrategy)
Sets a custom
StreamCachingStrategy to use. |
void |
setTransformers(List<TransformerDefinition> transformers)
Sets the transformers that can be referenced in the routes.
|
void |
setTypeConverterStatisticsEnabled(Boolean typeConverterStatisticsEnabled)
Sets whether or not type converter statistics is enabled.
|
void |
setUnitOfWorkFactory(UnitOfWorkFactory unitOfWorkFactory)
Sets a custom
UnitOfWorkFactory to use. |
void |
setupRoutes(boolean done)
Method to signal to
CamelContext that the process to initialize setup routes is in progress. |
void |
setUseBreadcrumb(Boolean useBreadcrumb)
Set whether breadcrumb is enabled.
|
void |
setUseDataType(Boolean useDataType)
Whether to enable using data type on Camel messages.
|
void |
setUseMDCLogging(Boolean useMDCLogging)
Set whether MDC is enabled.
|
void |
setUuidGenerator(UuidGenerator uuidGenerator)
Sets a custom
UuidGenerator (should only be set once) |
void |
setValidators(List<ValidatorDefinition> validators)
Sets the validators that can be referenced in the routes.
|
void |
shutdownRoute(String routeId)
Deprecated.
use
stopRoute(String) and removeRoute(String) |
void |
shutdownRoute(String routeId,
long timeout,
TimeUnit timeUnit)
Deprecated.
|
void |
start()
Starts the
CamelContext (important: the start method is not blocked, see more details
here). |
void |
startAllRoutes()
Starts all the routes which currently is not started.
|
void |
startRoute(RouteDefinition route)
Deprecated.
favor using
startRoute(String) |
void |
startRoute(String routeId)
Starts the given route if it has been previously stopped
|
void |
stop()
Stop and shutdown the
CamelContext (will stop all routes/components/endpoints etc and clear internal state/cache). |
void |
stopRoute(RouteDefinition route)
Deprecated.
favor using
stopRoute(String) |
void |
stopRoute(String routeId)
Stops the given route using
ShutdownStrategy . |
void |
stopRoute(String routeId,
long timeout,
TimeUnit timeUnit)
Stops the given route using
ShutdownStrategy with a specified timeout. |
boolean |
stopRoute(String routeId,
long timeout,
TimeUnit timeUnit,
boolean abortAfterTimeout)
Stops the given route using
ShutdownStrategy with a specified timeout
and optional abortAfterTimeout mode. |
void |
suspendRoute(String routeId)
Suspends the given route using
ShutdownStrategy . |
void |
suspendRoute(String routeId,
long timeout,
TimeUnit timeUnit)
Suspends the given route using
ShutdownStrategy with a specified timeout. |
isSuspended, resume, suspend
getDelayer, getShutdownRoute, getShutdownRunningTask, isAllowUseOriginalMessage, isAutoStartup, isHandleFault, isLogExhaustedMessageBody, isLogMask, isMessageHistory, isStreamCaching, isTracing, setAllowUseOriginalMessage, setAutoStartup, setDelayer, setHandleFault, setLogExhaustedMessageBody, setLogMask, setMessageHistory, setShutdownRoute, setShutdownRunningTask, setStreamCaching, setTracing
<T extends CamelContext> T adapt(Class<T> type)
CamelContext
to the specialized type.
For example to adapt to ModelCamelContext
,
or SpringCamelContext, or CdiCamelContext, etc.type
- the type to adapt toCamelContext
adapted to the given typeboolean isVetoStarted()
void start() throws Exception
CamelContext
(important: the start method is not blocked, see more details
here).
See more details at the class-level javadoc of this class.void stop() throws Exception
CamelContext
(will stop all routes/components/endpoints etc and clear internal state/cache).
See more details at the class-level javadoc of this class.CamelContextNameStrategy getNameStrategy()
void setNameStrategy(CamelContextNameStrategy nameStrategy)
nameStrategy
- name strategyManagementNameStrategy getManagementNameStrategy()
void setManagementNameStrategy(ManagementNameStrategy nameStrategy)
nameStrategy
- name strategyString getManagementName()
CamelContext
was registered in JMX.
The reason that a CamelContext
can have a different name in JMX is the fact to remedy for name clash
in JMX when having multiple CamelContext
s in the same JVM. Camel will automatic reassign and use
a free name to avoid failing to start.String getVersion()
ServiceStatus getStatus()
String getUptime()
long getUptimeMillis()
void addService(Object object) throws Exception
CamelContext
injected if its CamelContextAware
.
The service will also be enlisted in JMX for management (if JMX is enabled).
The service will be started, if its not already started.object
- the serviceException
- can be thrown when starting the servicevoid addService(Object object, boolean stopOnShutdown) throws Exception
CamelContext
injected if its CamelContextAware
.
The service will also be enlisted in JMX for management (if JMX is enabled).
The service will be started, if its not already started.
If the option closeOnShutdown is true then this CamelContext will control the lifecycle, ensuring
the service is stopped when the CamelContext stops.
If the option closeOnShutdown is false then this CamelContext will not stop the service when the CamelContext stops.object
- the servicestopOnShutdown
- whether to stop the service when this CamelContext shutdown.Exception
- can be thrown when starting the servicevoid addService(Object object, boolean stopOnShutdown, boolean forceStart) throws Exception
CamelContext
injected if its CamelContextAware
.
The service will also be enlisted in JMX for management (if JMX is enabled).
The service will be started, if its not already started.
If the option closeOnShutdown is true then this CamelContext will control the lifecycle, ensuring
the service is stopped when the CamelContext stops.
If the option closeOnShutdown is false then this CamelContext will not stop the service when the CamelContext stops.object
- the servicestopOnShutdown
- whether to stop the service when this CamelContext shutdown.forceStart
- whether to force starting the service right now, as otherwise the service may be deferred being started
to later using deferStartService(Object, boolean)
Exception
- can be thrown when starting the serviceboolean removeService(Object object) throws Exception
addService(Object)
method.
This method will not change the service lifecycle.object
- the serviceException
- can be thrown if error removing the serviceboolean hasService(Object object)
object
- the service<T> T hasService(Class<T> type)
type
- the class type<T> Set<T> hasServices(Class<T> type)
type
- the class typevoid deferStartService(Object object, boolean stopOnShutdown) throws Exception
CamelContext
is (almost started) or started and has initialized all its prior services and routes.
If CamelContext
is already started then the service is started immediately.object
- the servicestopOnShutdown
- whether to stop the service when this CamelContext shutdown. Setting this to true will keep a reference to the service in
this CamelContext
until the CamelContext is stopped. So do not use it for short lived services.Exception
- can be thrown when starting the service, which is only attempted if CamelContext
has already been started when calling this method.void addStartupListener(StartupListener listener) throws Exception
CamelContext
have just been started.
This allows listeners to do any custom work after the routes and other services have been started and are running.
Important: The listener will always be invoked, also if the CamelContext
has already been
started, see the StartupListener.onCamelContextStarted(CamelContext, boolean)
method.listener
- the listenerException
- can be thrown if CamelContext
is already started and the listener is invoked
and cause an exception to be thrownvoid addComponent(String componentName, Component component)
componentName
- the name the component is registered ascomponent
- the componentComponent hasComponent(String componentName)
componentName
- the name of the componentComponent getComponent(String componentName)
getComponent(String, boolean, boolean)
.componentName
- the name of the componentComponent getComponent(String name, boolean autoCreateComponents)
getComponent(String, boolean, boolean)
.name
- the name of the componentautoCreateComponents
- whether or not the component should
be lazily created if it does not already existComponent getComponent(String name, boolean autoCreateComponents, boolean autoStart)
name
- the name of the componentautoCreateComponents
- whether or not the component should
be lazily created if it does not already existautoStart
- whether to auto start the component if CamelContext
is already started.<T extends Component> T getComponent(String name, Class<T> componentType)
name
- the name to lookupcomponentType
- the expected typeList<String> getComponentNames()
Component removeComponent(String componentName)
componentName
- the component name to removeEndpointRegistry<String> getEndpointRegistry()
EndpointRegistry
Endpoint getEndpoint(String uri)
Endpoint
of the specified type.
If the name has a singleton endpoint registered, then the singleton is returned.
Otherwise, a new Endpoint
is created and registered in the EndpointRegistry
.uri
- the URI of the endpoint<T extends Endpoint> T getEndpoint(String name, Class<T> endpointType)
Endpoint
of the specified type.
If the name has a singleton endpoint registered, then the singleton is returned.
Otherwise, a new Endpoint
is created and registered in the EndpointRegistry
.name
- the name of the endpointendpointType
- the expected typeCollection<Endpoint> getEndpoints()
Collection
of all of the endpoints from the EndpointRegistry
Map<String,Endpoint> getEndpointMap()
Map
containing all of the endpoints from the EndpointRegistry
Endpoint hasEndpoint(String uri)
EndpointRegistry
uri
- the URI of the endpointEndpoint addEndpoint(String uri, Endpoint endpoint) throws Exception
EndpointRegistry
using the given URI.uri
- the URI to be used to resolve this endpointendpoint
- the endpoint to be added to the registryException
- if the new endpoint could not be started or the old endpoint could not be stoppedvoid removeEndpoint(Endpoint endpoint) throws Exception
EndpointRegistry
.
The endpoint being removed will be stopped first.endpoint
- the endpointException
- if the endpoint could not be stoppedCollection<Endpoint> removeEndpoints(String pattern) throws Exception
EndpointRegistry
.
The endpoints being removed will be stopped first.pattern
- an uri or pattern to matchException
- if at least one endpoint could not be stoppedfor pattern
void addRegisterEndpointCallback(EndpointStrategy strategy)
callback
to allow you to do custom
logic when an Endpoint
is about to be registered to the EndpointRegistry
.
When a callback is added it will be executed on the already registered endpoints allowing you to catch-upstrategy
- callback to be invokedvoid setRouteController(RouteController routeController)
routeController
- the route controllerRouteController getRouteController()
void setupRoutes(boolean done)
CamelContext
that the process to initialize setup routes is in progress.done
- false to start the process, call again with true to signal its done.isSetupRoutes()
List<RouteDefinition> getRouteDefinitions()
RouteDefinition getRouteDefinition(String id)
id
- id of the routeList<RestDefinition> getRestDefinitions()
void addRestDefinitions(Collection<RestDefinition> restDefinitions) throws Exception
restDefinitions
- the rest(s) definition to addException
void setRestConfiguration(RestConfiguration restConfiguration)
RestConfiguration
restConfiguration
- the REST configurationRestConfiguration getRestConfiguration()
void addRestConfiguration(RestConfiguration restConfiguration)
RestConfiguration
restConfiguration
- the REST configurationRestConfiguration getRestConfiguration(String component, boolean defaultIfNotFound)
component
- the component name to get the configurationdefaultIfNotFound
- determine if the default configuration is returned if there isn't a
specific configuration for the given componentCollection<RestConfiguration> getRestConfigurations()
ServiceCallConfigurationDefinition getServiceCallConfiguration(String serviceName)
serviceName
- name of service, or null to return the default configurationvoid setServiceCallConfiguration(ServiceCallConfigurationDefinition configuration)
configuration
- the configurationvoid setServiceCallConfigurations(List<ServiceCallConfigurationDefinition> configurations)
configurations
- the configuration listvoid addServiceCallConfiguration(String serviceName, ServiceCallConfigurationDefinition configuration)
serviceName
- name of the serviceconfiguration
- the configurationHystrixConfigurationDefinition getHystrixConfiguration(String id)
id
- id of the configuration, or null to return the default configurationvoid setHystrixConfiguration(HystrixConfigurationDefinition configuration)
configuration
- the configurationvoid setHystrixConfigurations(List<HystrixConfigurationDefinition> configurations)
configurations
- the configuration listvoid addHystrixConfiguration(String id, HystrixConfigurationDefinition configuration)
id
- name of the configurationconfiguration
- the configurationList<RouteStartupOrder> getRouteStartupOrder()
List<Route> getRoutes()
Route getRoute(String id)
id
- id of the routeProcessor getProcessor(String id)
id
- id of the processor<T extends Processor> T getProcessor(String id, Class<T> type)
id
- id of the processortype
- the processor typeClassCastException
- is thrown if the type is not correct type<T extends ManagedProcessorMBean> T getManagedProcessor(String id, Class<T> type)
id
- id of the processortype
- the managed processor type from the org.apache.camel.api.management.mbean
package.IllegalArgumentException
- if the type is not compliant<T extends ManagedRouteMBean> T getManagedRoute(String routeId, Class<T> type)
routeId
- id of the routetype
- the managed route type from the org.apache.camel.api.management.mbean
package.IllegalArgumentException
- if the type is not compliantManagedCamelContextMBean getManagedCamelContext()
ProcessorDefinition getProcessorDefinition(String id)
id
- id of the processor definition<T extends ProcessorDefinition> T getProcessorDefinition(String id, Class<T> type)
id
- id of the processor definitiontype
- the processor definition typeClassCastException
- is thrown if the type is not correct typevoid addRoutes(RoutesBuilder builder) throws Exception
CamelContext
is already started. You may want to check the state of CamelContext
before
adding the routes, using the getStatus()
method.
Important: Each route in the same CamelContext
must have an unique route id.
If you use the API from CamelContext
or ModelCamelContext
to add routes, then any
new routes which has a route id that matches an old route, then the old route is replaced by the new route.builder
- the builder which will create the routes and add them to this CamelContextException
- if the routes could not be created for whatever reasonRoutesDefinition loadRoutesDefinition(InputStream is) throws Exception
InputStream
.is
- input stream with the route(s) definition to addException
- if the route definitions could not be loaded for whatever reasonRestsDefinition loadRestsDefinition(InputStream is) throws Exception
InputStream
.is
- input stream with the rest(s) definition to addException
- if the rest definitions could not be loaded for whatever reasonvoid addRouteDefinitions(Collection<RouteDefinition> routeDefinitions) throws Exception
routeDefinitions
- the route(s) definition to addException
- if the route definitions could not be created for whatever reasonvoid addRouteDefinition(RouteDefinition routeDefinition) throws Exception
routeDefinition
- the route definition to addException
- if the route definition could not be created for whatever reasonvoid removeRouteDefinitions(Collection<RouteDefinition> routeDefinitions) throws Exception
routeDefinitions
- route(s) definitions to removeException
- if the route definitions could not be removed for whatever reasonvoid removeRouteDefinition(RouteDefinition routeDefinition) throws Exception
routeDefinition
- route definition to removeException
- if the route definition could not be removed for whatever reason@Deprecated void startRoute(RouteDefinition route) throws Exception
startRoute(String)
route
- the route to startException
- is thrown if the route could not be started for whatever reasonvoid startAllRoutes() throws Exception
Exception
- is thrown if a route could not be started for whatever reasonvoid startRoute(String routeId) throws Exception
routeId
- the route idException
- is thrown if the route could not be started for whatever reason@Deprecated void stopRoute(RouteDefinition route) throws Exception
stopRoute(String)
route
- the route to stopException
- is thrown if the route could not be stopped for whatever reasonvoid stopRoute(String routeId) throws Exception
ShutdownStrategy
.routeId
- the route idException
- is thrown if the route could not be stopped for whatever reasonsuspendRoute(String)
void stopRoute(String routeId, long timeout, TimeUnit timeUnit) throws Exception
ShutdownStrategy
with a specified timeout.routeId
- the route idtimeout
- timeouttimeUnit
- the unit to useException
- is thrown if the route could not be stopped for whatever reasonsuspendRoute(String, long, java.util.concurrent.TimeUnit)
boolean stopRoute(String routeId, long timeout, TimeUnit timeUnit, boolean abortAfterTimeout) throws Exception
ShutdownStrategy
with a specified timeout
and optional abortAfterTimeout mode.routeId
- the route idtimeout
- timeouttimeUnit
- the unit to useabortAfterTimeout
- should abort shutdown after timeoutException
- is thrown if the route could not be stopped for whatever reasonsuspendRoute(String, long, java.util.concurrent.TimeUnit)
@Deprecated void shutdownRoute(String routeId) throws Exception
stopRoute(String)
and removeRoute(String)
ShutdownStrategy
.routeId
- the route idException
- is thrown if the route could not be shutdown for whatever reason@Deprecated void shutdownRoute(String routeId, long timeout, TimeUnit timeUnit) throws Exception
stopRoute(String, long, java.util.concurrent.TimeUnit)
and removeRoute(String)
ShutdownStrategy
with a specified timeout.routeId
- the route idtimeout
- timeouttimeUnit
- the unit to useException
- is thrown if the route could not be shutdown for whatever reasonboolean removeRoute(String routeId) throws Exception
Endpoint
s which are in the static cache of
EndpointRegistry
and are only used by the route (not used by other routes)
will also be removed. But Endpoint
s which may have been created as part of routing messages by the route,
and those endpoints are enlisted in the dynamic cache of EndpointRegistry
are
not removed. To remove those dynamic kind of endpoints, use the removeEndpoints(String)
method.
If not removing those endpoints, they will be kept in the dynamic cache of EndpointRegistry
,
but my eventually be removed (evicted) when they have not been in use for a longer period of time; and the
dynamic cache upper limit is hit, and it evicts the least used endpoints.
End users can use this method to remove unwanted routes or temporary routes which no longer is in demand.routeId
- the route idException
- is thrown if the route could not be shutdown for whatever reasonvoid resumeRoute(String routeId) throws Exception
routeId
- the route idException
- is thrown if the route could not be resumed for whatever reasonvoid suspendRoute(String routeId) throws Exception
ShutdownStrategy
.
Suspending a route is more gently than stopping, as the route consumers will be suspended (if they support)
otherwise the consumers will be stopped.
By suspending the route services will be kept running (if possible) and therefore its faster to resume the route.
If the route does not support suspension the route will be stopped insteadrouteId
- the route idException
- is thrown if the route could not be suspended for whatever reasonvoid suspendRoute(String routeId, long timeout, TimeUnit timeUnit) throws Exception
ShutdownStrategy
with a specified timeout.
Suspending a route is more gently than stopping, as the route consumers will be suspended (if they support)
otherwise the consumers will be stopped.
By suspending the route services will be kept running (if possible) and therefore its faster to resume the route.
If the route does not support suspension the route will be stopped insteadrouteId
- the route idtimeout
- timeouttimeUnit
- the unit to useException
- is thrown if the route could not be suspended for whatever reasonServiceStatus getRouteStatus(String routeId)
routeId
- the route idboolean isStartingRoutes()
LifecycleStrategy
or the likes, in case
they need to react differently.boolean isSetupRoutes()
LifecycleStrategy
or the likes, in case
they need to react differently.
As the startup procedure of CamelContext
is slightly different when using plain Java versus
Spring or Blueprint, then we need to know when Spring/Blueprint is setting up the routes, which
can happen after the CamelContext
itself is in started state, due the asynchronous event nature
of especially Blueprint.TypeConverter getTypeConverter()
TypeConverterRegistry getTypeConverterRegistry()
Registry getRegistry()
<T> T getRegistry(Class<T> type)
type
- the registry type such as JndiRegistry
Injector getInjector()
ManagementMBeanAssembler getManagementMBeanAssembler()
List<LifecycleStrategy> getLifecycleStrategies()
void addLifecycleStrategy(LifecycleStrategy lifecycleStrategy)
lifecycleStrategy
- the strategyLanguage resolveLanguage(String language)
language
- name of the languageString resolvePropertyPlaceholders(String text) throws Exception
text
- the text such as an endpoint uri or the likesException
- is thrown if property placeholders was used and there was an error resolving themString getPropertyPrefixToken()
null
.null
String getPropertySuffixToken()
null
.null
List<String> getLanguageNames()
ProducerTemplate createProducerTemplate()
ProducerTemplate
which is started and therefore ready to use right away.
See this FAQ before use:
Why does Camel use too many threads with ProducerTemplate?
Important: Make sure to call Service.stop()
when you are done using the template,
to clean up any resources.
Will use cache size defined in Camel property with key Exchange.MAXIMUM_CACHE_POOL_SIZE
.
If no key was defined then it will fallback to a default size of 1000.
You can also use the ProducerTemplate.setMaximumCacheSize(int)
method to use a custom value
before starting the template.RuntimeCamelException
- is thrown if error starting the templateProducerTemplate createProducerTemplate(int maximumCacheSize)
ProducerTemplate
which is started and therefore ready to use right away.
See this FAQ before use:
Why does Camel use too many threads with ProducerTemplate?
Important: Make sure to call Service.stop()
when you are done using the template,
to clean up any resources.maximumCacheSize
- the maximum cache sizeRuntimeCamelException
- is thrown if error starting the templateFluentProducerTemplate createFluentProducerTemplate()
FluentProducerTemplate
which is started and therefore ready to use right away.
See this FAQ before use:
Why does Camel use too many threads with ProducerTemplate?
Important: Make sure to call Service.stop()
when you are done using the template,
to clean up any resources.
Will use cache size defined in Camel property with key Exchange.MAXIMUM_CACHE_POOL_SIZE
.
If no key was defined then it will fallback to a default size of 1000.
You can also use the FluentProducerTemplate.setMaximumCacheSize(int)
method to use a custom value
before starting the template.RuntimeCamelException
- is thrown if error starting the templateFluentProducerTemplate createFluentProducerTemplate(int maximumCacheSize)
FluentProducerTemplate
which is started and therefore ready to use right away.
See this FAQ before use:
Why does Camel use too many threads with ProducerTemplate?
Important: Make sure to call Service.stop()
when you are done using the template,
to clean up any resources.maximumCacheSize
- the maximum cache sizeRuntimeCamelException
- is thrown if error starting the templateConsumerTemplate createConsumerTemplate()
ConsumerTemplate
which is started and therefore ready to use right away.
See this FAQ before use:
Why does Camel use too many threads with ProducerTemplate? as it also applies for ConsumerTemplate.
Important: Make sure to call Service.stop()
when you are done using the template,
to clean up any resources.
Will use cache size defined in Camel property with key Exchange.MAXIMUM_CACHE_POOL_SIZE
.
If no key was defined then it will fallback to a default size of 1000.
You can also use the ConsumerTemplate.setMaximumCacheSize(int)
method to use a custom value
before starting the template.RuntimeCamelException
- is thrown if error starting the templateConsumerTemplate createConsumerTemplate(int maximumCacheSize)
ConsumerTemplate
which is started and therefore ready to use right away.
See this FAQ before use:
Why does Camel use too many threads with ProducerTemplate? as it also applies for ConsumerTemplate.
Important: Make sure to call Service.stop()
when you are done using the template,
to clean up any resources.maximumCacheSize
- the maximum cache sizeRuntimeCamelException
- is thrown if error starting the templatevoid addInterceptStrategy(InterceptStrategy interceptStrategy)
interceptStrategy
- the strategyList<InterceptStrategy> getInterceptStrategies()
@Deprecated ErrorHandlerBuilder getErrorHandlerBuilder()
ErrorHandlerFactory
in Camel 3.0void setErrorHandlerBuilder(ErrorHandlerFactory errorHandlerBuilder)
errorHandlerBuilder
- the builderScheduledExecutorService getErrorHandlerExecutorService()
void setDataFormats(Map<String,DataFormatDefinition> dataFormats)
dataFormats
- the data formatsMap<String,DataFormatDefinition> getDataFormats()
DataFormat resolveDataFormat(String name)
name
- the data format name or a reference to it in the Registry
DataFormat createDataFormat(String name)
name
- the data format name or a reference to a data format factory in the Registry
DataFormatDefinition resolveDataFormatDefinition(String name)
name
- the data format definition name or a reference to it in the Registry
DataFormatResolver getDataFormatResolver()
void setDataFormatResolver(DataFormatResolver dataFormatResolver)
dataFormatResolver
- the resolvervoid setTransformers(List<TransformerDefinition> transformers)
transformers
- the transformersList<TransformerDefinition> getTransformers()
Transformer resolveTransformer(String model)
model
- data model name.Transformer resolveTransformer(DataType from, DataType to)
from
- from data typeto
- to data typeTransformerRegistry getTransformerRegistry()
TransformerRegistry
void setValidators(List<ValidatorDefinition> validators)
validators
- the validatorsList<ValidatorDefinition> getValidators()
Validator resolveValidator(DataType type)
type
- the data typeValidatorRegistry getValidatorRegistry()
ValidatorRegistry
@Deprecated void setProperties(Map<String,String> properties)
setGlobalOptions(Map) instead
.void setGlobalOptions(Map<String,String> globalOptions)
resolvePropertyPlaceholders(String)
method and see more details
at the property placeholder documentation.globalOptions
- global options that can be referenced in the camel context@Deprecated Map<String,String> getProperties()
getGlobalOptions()
instead.Map<String,String> getGlobalOptions()
resolvePropertyPlaceholders(String)
method and see more details
at the property placeholder documentation.@Deprecated String getProperty(String key)
getGlobalOption(String)
instead.String getGlobalOption(String key)
resolvePropertyPlaceholders(String)
method and see more details
at the property placeholder documentation.FactoryFinder getDefaultFactoryFinder()
void setFactoryFinderResolver(FactoryFinderResolver resolver)
resolver
- the factory finder resolverFactoryFinder getFactoryFinder(String path) throws NoFactoryAvailableException
path
- the META-INF pathNoFactoryAvailableException
- is thrown if a factory could not be foundClassResolver getClassResolver()
PackageScanClassResolver getPackageScanClassResolver()
void setClassResolver(ClassResolver resolver)
resolver
- the resolvervoid setPackageScanClassResolver(PackageScanClassResolver resolver)
resolver
- the resolvervoid setProducerServicePool(ServicePool<Endpoint,Producer> servicePool)
Producer
pooling.servicePool
- the poolServicePool<Endpoint,Producer> getProducerServicePool()
Producer
pooling.void setPollingConsumerServicePool(ServicePool<Endpoint,PollingConsumer> servicePool)
PollingConsumer
pooling.servicePool
- the poolServicePool<Endpoint,PollingConsumer> getPollingConsumerServicePool()
Producer
pooling.void setNodeIdFactory(NodeIdFactory factory)
factory
- custom factory to useNodeIdFactory getNodeIdFactory()
ManagementStrategy getManagementStrategy()
void setManagementStrategy(ManagementStrategy strategy)
strategy
- the management strategyInterceptStrategy getDefaultTracer()
void setDefaultTracer(InterceptStrategy tracer)
tracer
- the custom tracer to use as default tracerInterceptStrategy getDefaultBacklogTracer()
void setDefaultBacklogTracer(InterceptStrategy backlogTracer)
backlogTracer
- the custom tracer to use as default backlog tracerInterceptStrategy getDefaultBacklogDebugger()
void setDefaultBacklogDebugger(InterceptStrategy backlogDebugger)
backlogDebugger
- the custom debugger to use as default backlog debuggervoid disableJMX() throws IllegalStateException
ManagementStrategy
.
Important: This method must be called before the CamelContext
is started.IllegalStateException
- is thrown if the CamelContext
is not in stopped state.InflightRepository getInflightRepository()
void setInflightRepository(InflightRepository repository)
repository
- the repositoryAsyncProcessorAwaitManager getAsyncProcessorAwaitManager()
AsyncProcessor
await manager.void setAsyncProcessorAwaitManager(AsyncProcessorAwaitManager manager)
AsyncProcessor
await manager.manager
- the managerClassLoader getApplicationContextClassLoader()
void setApplicationContextClassLoader(ClassLoader classLoader)
classLoader
- the class loaderShutdownStrategy getShutdownStrategy()
void setShutdownStrategy(ShutdownStrategy shutdownStrategy)
shutdownStrategy
- the custom strategyExecutorServiceManager getExecutorServiceManager()
ExecutorServiceManager
@Deprecated ExecutorServiceStrategy getExecutorServiceStrategy()
getExecutorServiceManager()
ExecutorServiceStrategy
void setExecutorServiceManager(ExecutorServiceManager executorServiceManager)
ExecutorServiceManager
executorServiceManager
- the custom managerProcessorFactory getProcessorFactory()
ProcessorFactory
void setProcessorFactory(ProcessorFactory processorFactory)
ProcessorFactory
processorFactory
- the custom factoryMessageHistoryFactory getMessageHistoryFactory()
MessageHistoryFactory
void setMessageHistoryFactory(MessageHistoryFactory messageHistoryFactory)
MessageHistoryFactory
messageHistoryFactory
- the custom factoryDebugger getDebugger()
Debugger
void setDebugger(Debugger debugger)
Debugger
debugger
- the debuggerUuidGenerator getUuidGenerator()
UuidGenerator
void setUuidGenerator(UuidGenerator uuidGenerator)
UuidGenerator
(should only be set once)uuidGenerator
- the UUID Generator@Deprecated Boolean isLazyLoadTypeConverters()
@Deprecated void setLazyLoadTypeConverters(Boolean lazyLoadTypeConverters)
lazyLoadTypeConverters
- true to load lazy, false to load on startupBoolean isLoadTypeConverters()
void setLoadTypeConverters(Boolean loadTypeConverters)
loadTypeConverters
- whether to load custom type converters.Boolean isTypeConverterStatisticsEnabled()
void setTypeConverterStatisticsEnabled(Boolean typeConverterStatisticsEnabled)
org.apache.camel.spi.TypeConverterRegistry#getStatistics()#setTypeConverterStatisticsEnabled(Boolean)
method,
or from JMX on the ManagedTypeConverterRegistryMBean
mbean.typeConverterStatisticsEnabled
- true to enable, false to disableBoolean isUseMDCLogging()
void setUseMDCLogging(Boolean useMDCLogging)
useMDCLogging
- true to enable MDC logging, false to disableBoolean isUseDataType()
void setUseDataType(Boolean useDataType)
useDataType
- true to enable data type on Camel messages.Boolean isUseBreadcrumb()
void setUseBreadcrumb(Boolean useBreadcrumb)
useBreadcrumb
- true to enable breadcrumb, false to disableString resolveComponentDefaultName(String javaType)
javaType
- the FQN name of the java typeMap<String,Properties> findComponents() throws LoadPropertiesException, IOException
Registry
.LoadPropertiesException
- is thrown if error during classpath discovery of the componentsIOException
- is thrown if error during classpath discovery of the componentsMap<String,Properties> findEips() throws LoadPropertiesException, IOException
LoadPropertiesException
- is thrown if error during classpath discovery of the EIPsIOException
- is thrown if error during classpath discovery of the EIPs@Deprecated String getComponentDocumentation(String componentName) throws IOException
IOException
String getComponentParameterJsonSchema(String componentName) throws IOException
IOException
String getDataFormatParameterJsonSchema(String dataFormatName) throws IOException
DataFormat
parameters for the given data format name.IOException
String getLanguageParameterJsonSchema(String languageName) throws IOException
Language
parameters for the given language name.IOException
String getEipParameterJsonSchema(String eipName) throws IOException
IOException
String explainEipJson(String nameOrId, boolean includeAllOptions)
nameOrId
- the name of the EIP (NamedNode.getShortName()
or a node id to refer to a specific node from the routes.includeAllOptions
- whether to include non configured options also (eg default options)String explainComponentJson(String componentName, boolean includeAllOptions)
componentName
- the name of the component.includeAllOptions
- whether to include non configured options also (eg default options)String explainDataFormatJson(String dataFormatName, DataFormat dataFormat, boolean includeAllOptions)
dataFormat
- the data format instance.includeAllOptions
- whether to include non configured options also (eg default options)String explainEndpointJson(String uri, boolean includeAllOptions)
uri
- the endpoint uriincludeAllOptions
- whether to include non configured options also (eg default options)String createRouteStaticEndpointJson(String routeId)
routeId
- for a particular route, or null for all routesString createRouteStaticEndpointJson(String routeId, boolean includeDynamic)
routeId
- for a particular route, or null for all routesincludeDynamic
- whether to include dynamic endpointsStreamCachingStrategy getStreamCachingStrategy()
StreamCachingStrategy
to use.void setStreamCachingStrategy(StreamCachingStrategy streamCachingStrategy)
StreamCachingStrategy
to use.UnitOfWorkFactory getUnitOfWorkFactory()
UnitOfWorkFactory
to use.void setUnitOfWorkFactory(UnitOfWorkFactory unitOfWorkFactory)
UnitOfWorkFactory
to use.RuntimeEndpointRegistry getRuntimeEndpointRegistry()
RuntimeEndpointRegistry
to use, or null if none is in use.void setRuntimeEndpointRegistry(RuntimeEndpointRegistry runtimeEndpointRegistry)
RuntimeEndpointRegistry
to use.RestRegistry getRestRegistry()
RestRegistry
to usevoid setRestRegistry(RestRegistry restRegistry)
RestRegistry
to use.void addRoutePolicyFactory(RoutePolicyFactory routePolicyFactory)
routePolicyFactory
- the factoryList<RoutePolicyFactory> getRoutePolicyFactories()
ModelJAXBContextFactory getModelJAXBContextFactory()
void setModelJAXBContextFactory(ModelJAXBContextFactory modelJAXBContextFactory)
modelJAXBContextFactory
- a JAXB Context factoryReloadStrategy getReloadStrategy()
ReloadStrategy
if in use.void setReloadStrategy(ReloadStrategy reloadStrategy)
ReloadStrategy
to be usedRuntimeCamelCatalog getRuntimeCamelCatalog()
RuntimeCamelCatalog
for this CamelContext.Set<LogListener> getLogListeners()
LogListener
.void addLogListener(LogListener listener)
LogListener
.void setSSLContextParameters(SSLContextParameters sslContextParameters)
SSLContextParameters getSSLContextParameters()
HeadersMapFactory getHeadersMapFactory()
HeadersMapFactory
to use.void setHeadersMapFactory(HeadersMapFactory factory)
HeadersMapFactory
to be used.HealthCheckRegistry getHealthCheckRegistry()
HealthCheckRegistry
, by default no registry is
present and it must be explicit activated. Components can register/unregister
health checks in response to life-cycle events (i.e. start/stop).
This registry is not used by the camel context but it is up to the impl to
properly use it, i.e.
- a RouteController could use the registry to decide to restart a route
with failing health checks
- spring boot could integrate such checks within its health endpoint or
make it available only as separate endpoint.void setHealthCheckRegistry(HealthCheckRegistry healthCheckRegistry)
HealthCheckRegistry
.Apache Camel