Camel Spring Boot

Infinispan Embedded

Read and write the entries of caches of an Infinispan cache manager embedded in the application, and receive their events.

What’s inside

Please refer to the above links for usage and configuration details.

Maven coordinates

<dependency>
    <groupId>org.apache.camel.springboot</groupId>
    <artifactId>camel-infinispan-embedded-starter</artifactId>
</dependency>

Spring Boot Auto-Configuration

The starter supports 17 options, which are listed below.

Name Description Default Type

camel.component.infinispan-embedded.autowired-enabled

Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc.

true

Boolean

camel.component.infinispan-embedded.bridge-error-handler

Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions (if possible) occurred while the Camel consumer is trying to pickup incoming messages, or the likes, will now be processed as a message and handled by the routing Error Handler. Important: This is only possible if the 3rd party component allows Camel to be alerted if an exception was thrown. Some components handle this internally only, and therefore bridgeErrorHandler is not possible. In other situations we may improve the Camel component to hook into the 3rd party component and make this possible for future releases. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions, that will be logged at WARN or ERROR level and ignored.

false

Boolean

camel.component.infinispan-embedded.cache-container

To use a custom org.infinispan.manager.EmbeddedCacheManager as the cache manager. When set or autowired, the cacheContainerConfiguration and configurationUri options are not used, and Camel does not stop the cache manager. Read on the component only, as the cache manager is shared by all the endpoints of the component: set on an endpoint, this option is not used. The option is a org.infinispan.manager.EmbeddedCacheManager type.

EmbeddedCacheManager

camel.component.infinispan-embedded.cache-container-configuration

The org.infinispan.configuration.cache.Configuration of the default cache, named default, of the cache manager that Camel creates when cacheContainer is not set. When set, configurationUri is not used. Read on the component only, as the cache manager is shared by all the endpoints of the component: set on an endpoint, this option is not used. The option is a org.infinispan.configuration.cache.Configuration type.

Configuration

camel.component.infinispan-embedded.clustered-listener

Whether the consumer registers its listener as an Infinispan clustered listener, which receives the events of the changes made on all the nodes of the cluster, not only on the local node. A clustered listener receives only the events after a change, and only for entries that are created, modified, removed or expired. Not used when customListener or queryBuilder is set.

false

Boolean

camel.component.infinispan-embedded.configuration

The configuration of the component, which each endpoint copies and then changes with its own options. The cache manager of the component uses only this configuration. The option is a org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration type.

InfinispanEmbeddedConfiguration

camel.component.infinispan-embedded.configuration-uri

The location of the configuration file of the cache manager that Camel creates, read from the classpath unless it has a prefix such as file:. Not used when cacheContainer or cacheContainerConfiguration is set. For infinispan-embedded it is an Infinispan XML configuration file, read on the component only; for infinispan it is a Hot Rod client properties file.

String

camel.component.infinispan-embedded.custom-listener

To use a custom listener, a subclass of org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedCustomListener annotated with the Infinispan Listener annotation, that the consumer registers on the cache in place of its own listener. The eventTypes, sync and clusteredListener options are not used then. Not used when queryBuilder is set. The option is a org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedCustomListener type.

InfinispanEmbeddedCustomListener

camel.component.infinispan-embedded.enabled

Whether to enable auto configuration of the infinispan-embedded component. This is enabled by default.

Boolean

camel.component.infinispan-embedded.event-types

The comma-separated names of the Infinispan event types that the consumer passes on to the route, for example CACHE_ENTRY_CREATED,CACHE_ENTRY_REMOVED. If not set, the consumer passes on all events. Its listener receives only the events of the types CACHE_ENTRY_ACTIVATED, CACHE_ENTRY_CREATED, CACHE_ENTRY_EXPIRED, CACHE_ENTRY_INVALIDATED, CACHE_ENTRY_LOADED, CACHE_ENTRY_MODIFIED, CACHE_ENTRY_PASSIVATED, CACHE_ENTRY_REMOVED and CACHE_ENTRY_VISITED. Not used when customListener or queryBuilder is set.

String

camel.component.infinispan-embedded.flags

A comma-separated list of names of org.infinispan.context.Flag, for example SKIP_CACHE_LOAD,SKIP_CACHE_STORE, that the endpoints apply to each cache that they use. Read on the component only, as the cache manager is shared by all the endpoints of the component: set on an endpoint, this option is not used.

String

camel.component.infinispan-embedded.lazy-start-producer

Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel’s routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing.

false

Boolean

camel.component.infinispan-embedded.operation

The operation that the producer performs. The CamelInfinispanOperation header replaces this option.

put

InfinispanOperation

camel.component.infinispan-embedded.query-builder

To use a custom org.apache.camel.component.infinispan.InfinispanQueryBuilder that builds the query of the QUERY operation of the producer, which the CamelInfinispanQueryBuilder header replaces. When set, the consumer registers a continuous query instead of a listener, and receives the CacheEntryJoining, CacheEntryUpdated and CacheEntryLeaving events of the entries that match the query. The option is a org.apache.camel.component.infinispan.InfinispanQueryBuilder type.

InfinispanQueryBuilder

camel.component.infinispan-embedded.remapping-function

The java.util.function.BiFunction that the COMPUTE and COMPUTEASYNC operations call with the key and the current value of the entry, or null if there is none, to compute its new value. If the function returns null, the entry is removed. The option is a java.util.function.BiFunction type.

BiFunction

camel.component.infinispan-embedded.result-header

The name of the header in which the producer stores the result of the operation, keeping the message body. If not set, the result replaces the message body. The CamelInfinispanOperationResultHeader header replaces this option.

String

camel.component.infinispan-embedded.sync

Whether Infinispan calls the listener of the consumer synchronously, so the cache operation that caused the event waits until the route has processed it. If false, Infinispan calls the listener in a thread of its own. Not used when customListener or queryBuilder is set.

true

Boolean