Architecture

CamelContext Auto Configuration

qianmoQqianmoQ· 更新于 2026-09-22· 阅读 14 分钟· 0 次阅读

登录后可跨设备保存划线和私人笔记登录

CamelContext Auto Configuration

The CamelContext is autoconfigured when running Camel with either Camel Main, Camel Spring Boot, Camel Quarkus.

Camel Autoconfiguration

Under these runtimes then the autoconfiguration is performed by shared code from the camel-main JAR to ensure the configuration is similar on these runtimes.

The autoconfiguration is executed in several steps:

  1. Configure CamelContext (and more such as components) from properties from external sources like application.properties|yaml
  2. Configure optional services that have been registered in the Registry

Autoconfiguration of Properties

This is used for configuring the standard set of more than 100 options which are listed in the Camel Main Options table at Camel Main.

When using Camel on Spring Boot, then these options are prefixed with camel.springboot, and not camel.main.

Autoconfiguration of Optional Services

After configuring the standard options, then Camel will look in the Registry for custom services to be used. For example, to plug in a custom UnitOfWorkFactory.

The services can be anything that can be plugged into Camel (typically services that implement an SPI interface org.apache.camel.spi).

The following SPI services can only a single instance (singleton) be in the Registry.

SPIDescription
AsyncProcessorAwaitManagerTo use a custom async processor await manager
BacklogTracerTo use a custom backlog tracer
ClassResolverTo use a custom class resolver. This is only necessary if you run Camel on a special application server to deal with classloading.
DebuggerTo use a custom debugger
EventFactoryTo use a custom event notifier factory
ExchangeFactoryTo use a custom exchange factory
ExecutorServiceManagerTo use a custom thread pool manager
FactoryFinderResolverTo use a custom factory finder resolver. This is only necessary if you run Camel on a special application server to deal with classloading.
HealthCheckRegistryTo use a custom health check registry
InflightRepositoryTo use a custom in flight repository
ManagementObjectNameStrategyTo use a custom JMX MBean object naming
ManagementStrategyTo use a custom JMX management strategy
MessageHistoryFactoryTo use a custom factory for message history
ModelJAXBContextFactoryTo use a custom JAXBContext factory (only needed if you run Camel on a special application server to deal with JAXB classloading)
NodeIdFactoryTo use a custom factory for creating auto generated node ids
ProcessorFactoryTo use a custom factory for creating EIP processors
PropertiesComponentTo use a custom properties component
ReactiveExecutorTo use a custom reactive engine in the Camel routing engine
RouteControllerTo use a custom route controller
RuntimeEndpointRegistryTo use a custom runtime endpoint registry
ShutdownStrategyTo use a custom shutdown strategy
StartupStepRecorderTo use a custom startup recorder
ThreadPoolFactoryTo use a custom thread pool factory
UnitOfWorkFactoryTo use a custom unit of work factory
UuidGeneratorTo use a custom uuid generator

For the following SPI services, there can be multiple (one or more) implementations in the Registry.

SPIsDescription
CamelClusterServiceAdds all the custom camel-cluster services
EndpointStrategyAdds all the custom endpoint strategies
EventNotifierAdds all the custom event notifiers
GlobalSSLContextParametersSupplierTo use a custom supplier for JSSE (Java Security)
InterceptStrategyAdds all the custom intercept strategies
LifecycleStrategyAdds all the custom lifecycle strategies
LogListenerAdds all the log listeners
ModelLifecycleStrategyAdds all the custom model lifecycle strategies
RoutePolicyFactoryAdds all the custom route policy factories
ServiceRegistryAdds all the custom camel-cloud service registries
ThreadPoolProfileAdds all the thread pool profiles
TypeConvertersAdds all the custom type converters

评论

登录后参与评论

正在加载评论…