2.50. Infinispan


Read and write from/to Infinispan distributed key/value store and data grid.

2.50.1. What’s inside

Refer to the above link for usage and configuration details.

2.50.2. Maven coordinates

Create a new project with this extension on code.camel.redhat.com

Or add the coordinates to your existing project:

<dependency>
    <groupId>org.apache.camel.quarkus</groupId>
    <artifactId>camel-quarkus-infinispan</artifactId>
</dependency>

2.50.3. Usage

2.50.3.1. Infinispan client configuration

You can configure Camel Infinispan in one of two ways.

More details about these two configuration methods is described below.

When using 'pure' Camel Infinispan component and endpoint configuration (I.e where’s there’s no quarkus.infinispan-client configuration set), you must disable generation of the default Quarkus Infinispan RemoteCacheManager bean by adding the following configuration to application.properties.

quarkus.infinispan-client.devservices.create-default-client=false

If you wish to take advantage of Quarkus Dev Services for Infinispan, the Camel Infinispan component can be configured as follows in application.properties.

# dev / test mode Quarkus Infinispan Dev services configuration
quarkus.infinispan-client.devservices.port=31222
%dev,test.camel.component.infinispan.username=admin
%dev,test.camel.component.infinispan.password=password
%dev,test.camel.component.infinispan.secure=true
%dev,test.camel.component.infinispan.hosts=localhost:31222

# Example prod mode configuration
%prod.camel.component.infinispan.username=prod-user
%prod.camel.component.infinispan.password=prod-password
%prod.camel.component.infinispan.secure=true
%prod.camel.component.infinispan.hosts=infinispan.prod:11222

2.50.3.3. Quarkus Infinispan configuration

When using the Quarkus Infinispan extension configuration properties, the Quarkus Infinispan extensions creates and manages a RemoteCacheManager bean.

The bean will get automatically autowired into the Camel Infinispan component on application startup.

Note that to materialize the RemoteCacheManager beans, you must add injection points for them. For example:

public class Routes extends RouteBuilder {
    // Injects the default unnamed RemoteCacheManager
    @Inject
    RemoteCacheManager cacheManager;

    // If configured, injects an optional named RemoteCacheManager
    @Inject
    @InfinispanClientName("myNamedClient")
    RemoteCacheManager namedCacheManager;

    @Override
    public void configure() {
        // Route configuration here...
    }
}

2.50.4. Additional Camel Quarkus configuration

If you chose to use the InfinispanRemoteAggregationRepository in native mode, then you must enable native serialization support.

Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

关于红帽文档

Legal Notice

Theme

© 2026 Red Hat
返回顶部