Class CamelContextConfiguration
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfacestatic interfacestatic interfacestatic interface -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.camel.spi.Breakpointorg.apache.camel.Serviceorg.apache.camel.spi.Registryregistry()voidreplaceRouteFromWith(String routeId, String fromEndpoint) To replace from routes with a different oneintbooleanwithAutoStartupExcludePatterns(String pattern) Used for exclusive filtering of routes to not automatically start with Camel starts.withBreakpoint(DebugBreakpoint breakpoint) Provides a debug breakpoint to be executed before and/or after entering processorswithCamelContextService(org.apache.camel.Service camelContextService) Allows a service to be registered a separate lifecycle service to start and stop the context; such as for Spring when the ApplicationContext is started and stopped, rather than directly stopping the CamelContextwithCamelContextSupplier(CamelContextConfiguration.CamelContextSupplier camelContextSupplier) To set a supplier for the CamelContextwithIgnoreMissingLocationWithPropertiesComponent(Boolean ignoreMissingLocationWithPropertiesComponent) Whether to ignore missing locations with thePropertiesComponent.withMockEndpoints(String mockEndpoints) Enables auto mocking endpoints based on the pattern.withMockEndpointsAndSkip(String mockEndpointsAndSkip) Enables auto mocking endpoints based on the pattern, and skip sending to original endpoint.protected CamelContextConfigurationwithPostProcessor(CamelContextConfiguration.PostProcessor postProcessor) Set a custom post-test processorwithRegistry(org.apache.camel.spi.Registry registry) Sets a customRegistry.withRegistryBinder(CamelContextConfiguration.RegistryBinder registryBinder) A supplier to create a customRegistry.withRouteFilterExcludePattern(String routeFilterExcludePattern) Used for filtering routes matching the given pattern, which follows the following rules:withRouteFilterIncludePattern(String routeFilterIncludePattern) Used for filtering routes matching the given pattern, which follows the following rules:protected CamelContextConfigurationwithRoutesSupplier(CamelContextConfiguration.RoutesSupplier routesSupplier) A supplier that classes can use to create aRouteBuilderto define the routes for testingwithShutdownTimeout(int shutdownTimeout) Sets the timeout to use when shutting down (unit in seconds).withStubEndpoints(String pattern) Enables auto stub endpoints based on the pattern.withUseOverridePropertiesWithPropertiesComponent(Properties useOverridePropertiesWithPropertiesComponent) To include and override properties with the CamelPropertiesComponent.
-
Constructor Details
-
CamelContextConfiguration
public CamelContextConfiguration()
-
-
Method Details
-
routeFilterIncludePattern
-
withRouteFilterIncludePattern
Used for filtering routes matching the given pattern, which follows the following rules:- Match by route id - Match by route input endpoint uri
The matching is using exact match, by wildcard and regular expression.
For example, to only include routes which start with foo in their route id's, use: include=foo* And to exclude routes which start from JMS endpoints, use: exclude=jms:*
Multiple patterns can be separated by comma, for example, to exclude both foo and bar routes, use: exclude=foo*,bar*
Exclude takes precedence over include.
-
routeFilterExcludePattern
-
withRouteFilterExcludePattern
Used for filtering routes matching the given pattern, which follows the following rules:- Match by route id - Match by route input endpoint uri
The matching is using exact match, by wildcard and regular expression.
For example, to only include routes which starts with foo in their route id's, use: include=foo* And to exclude routes which start from JMS endpoints, use: exclude=jms:*
Multiple patterns can be separated by comma, for example, to exclude both foo and bar routes, use: exclude=foo*,bar*
Exclude takes precedence over include.
-
registry
public org.apache.camel.spi.Registry registry() -
withRegistry
Sets a customRegistry.However, if you need to bind beans to the registry, then this is possible already with the bind method on registry, and there is no need to use this method.
-
useDebugger
public boolean useDebugger() -
breakpoint
public org.apache.camel.spi.Breakpoint breakpoint() -
withBreakpoint
Provides a debug breakpoint to be executed before and/or after entering processors- Parameters:
breakpoint- a new debug breakpoint
-
mockEndpoints
-
withMockEndpoints
Enables auto mocking endpoints based on the pattern. Use * to mock all endpoints.- See Also:
-
mockEndpointsAndSkip
-
withMockEndpointsAndSkip
Enables auto mocking endpoints based on the pattern, and skip sending to original endpoint. Use * to mock all endpoints.- See Also:
-
stubEndpoints
-
withStubEndpoints
Enables auto stub endpoints based on the pattern. Use * to stub all endpoints.- See Also:
-
autoStartupExcludePatterns
-
withAutoStartupExcludePatterns
Used for exclusive filtering of routes to not automatically start with Camel starts. The pattern support matching by route id or endpoint urls. Multiple patterns can be specified separated by comma, as example, to exclude all the routes starting from kafka or jms use: kafka,jms. -
useOverridePropertiesWithPropertiesComponent
-
withUseOverridePropertiesWithPropertiesComponent
public CamelContextConfiguration withUseOverridePropertiesWithPropertiesComponent(Properties useOverridePropertiesWithPropertiesComponent) To include and override properties with the CamelPropertiesComponent.- Parameters:
useOverridePropertiesWithPropertiesComponent- additional properties to add/override.
-
ignoreMissingLocationWithPropertiesComponent
-
withIgnoreMissingLocationWithPropertiesComponent
public CamelContextConfiguration withIgnoreMissingLocationWithPropertiesComponent(Boolean ignoreMissingLocationWithPropertiesComponent) Whether to ignore missing locations with thePropertiesComponent. For example, when unit testing, you may want to ignore locations that are not available in the environment used for testing.- Parameters:
ignoreMissingLocationWithPropertiesComponent- Use true to ignore, false to not ignore, and null to leave it as configured on thePropertiesComponent
-
camelContextSupplier
-
withCamelContextSupplier
public CamelContextConfiguration withCamelContextSupplier(CamelContextConfiguration.CamelContextSupplier camelContextSupplier) To set a supplier for the CamelContext- Parameters:
camelContextSupplier- A supplier for the Camel context
-
registryBinder
-
withRegistryBinder
public CamelContextConfiguration withRegistryBinder(CamelContextConfiguration.RegistryBinder registryBinder) A supplier to create a customRegistry.Do not use it for binding beans to the registry.
-
shutdownTimeout
public int shutdownTimeout() -
withShutdownTimeout
Sets the timeout to use when shutting down (unit in seconds). By default, it uses 10 seconds.- Parameters:
shutdownTimeout- the timeout to use
-
camelContextService
public org.apache.camel.Service camelContextService() -
withCamelContextService
public CamelContextConfiguration withCamelContextService(org.apache.camel.Service camelContextService) Allows a service to be registered a separate lifecycle service to start and stop the context; such as for Spring when the ApplicationContext is started and stopped, rather than directly stopping the CamelContext -
routesSupplier
-
withRoutesSupplier
protected CamelContextConfiguration withRoutesSupplier(CamelContextConfiguration.RoutesSupplier routesSupplier) A supplier that classes can use to create aRouteBuilderto define the routes for testing -
fromEndpoints
-
replaceRouteFromWith
To replace from routes with a different one- Parameters:
routeId-fromEndpoint-
-
postProcessor
-
withPostProcessor
protected CamelContextConfiguration withPostProcessor(CamelContextConfiguration.PostProcessor postProcessor) Set a custom post-test processor- Parameters:
postProcessor- the post-test processor to use
-