The cache component enables you to perform caching operations using EHCache as the Cache Implementation. The cache itself is created on demand or if a cache of that name already exists then it is simply utilized with its original settings. This component supports producer and event based consumer endpoints. The Cache consumer is an event based consumer and can be used to listen and respond to specific cache activities. If you need to perform selections from a pre-existing cache, use the processors defined for the cache component.
Name | Kind | Group | Required | Default | Type | Enum | Description |
---|---|---|---|---|---|---|---|
cacheName | path | common | true | java.lang.String | Name of the cache | ||
diskExpiryThreadIntervalSeconds | parameter | common | long | The number of seconds between runs of the disk expiry thread. | |||
diskPersistent | parameter | common | boolean | Whether the disk store persists between restarts of the application. | |||
diskStorePath | parameter | common | java.lang.String | This parameter is ignored. CacheManager sets it using setter injection. | |||
eternal | parameter | common | boolean | Sets whether elements are eternal. If eternal, timeouts are ignored and the element never expires. | |||
key | parameter | common | java.lang.String | The default key to use. If a key is provided in the message header, then the key from the header takes precedence. | |||
maxElementsInMemory | parameter | common | 1000 | int | The number of elements that may be stored in the defined cache in memory. | ||
memoryStoreEvictionPolicy | parameter | common | LFU | net.sf.ehcache.store.MemoryStoreEvictionPolicy | LRU LFU FIFO |
Which eviction strategy to use when maximum number of elements in memory is reached. The strategy defines
which elements to be removed.
|
|
objectCache | parameter | common | boolean | Whether to turn on allowing to store non serializable objects in the cache. If this option is enabled then overflow to disk cannot be enabled as well. | |||
operation | parameter | common | java.lang.String | The default cache operation to use. If an operation in the message header, then the operation from the header takes precedence. | |||
overflowToDisk | parameter | common | true | boolean | Specifies whether cache may overflow to disk | ||
timeToIdleSeconds | parameter | common | 300 | long | The maximum amount of time between accesses before an element expires | ||
timeToLiveSeconds | parameter | common | 300 | long | The maximum time between creation time and when an element expires. Is used only if the element is not eternal | ||
bridgeErrorHandler | parameter | consumer | boolean | Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions occurred while the consumer is trying to pickup incoming messages, or the likes, will now be processed as a message and handled by the routing Error Handler. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions, that will be logged at WARN/ERROR level and ignored. | |||
exceptionHandler | parameter | consumer (advanced) | org.apache.camel.spi.ExceptionHandler | To let the consumer use a custom ExceptionHandler. Notice if the option bridgeErrorHandler is enabled then this options is not in use. By default the consumer will deal with exceptions, that will be logged at WARN/ERROR level and ignored. | |||
exchangePattern | parameter | consumer (advanced) | org.apache.camel.ExchangePattern | InOnly RobustInOnly InOut InOptionalOut OutOnly RobustOutOnly OutIn OutOptionalIn |
Sets the exchange pattern when the consumer creates an exchange. | ||
cacheLoaderRegistry | parameter | advanced | org.apache.camel.component.cache.CacheLoaderRegistry | To configure cache loader using the CacheLoaderRegistry | |||
cacheManagerFactory | parameter | advanced | org.apache.camel.component.cache.CacheManagerFactory | To use a custom CacheManagerFactory for creating the CacheManager to be used by this endpoint. By default the CacheManagerFactory configured on the component is used. | |||
eventListenerRegistry | parameter | advanced | org.apache.camel.component.cache.CacheEventListenerRegistry | To configure event listeners using the CacheEventListenerRegistry | |||
synchronous | parameter | advanced | false | boolean | Sets whether synchronous processing should be strictly used, or Camel is allowed to use asynchronous processing (if supported). |