// Do not edit directly!
// This file was generated by camel-quarkus-maven-plugin:update-extension-doc-page
[id="extensions-infinispan-cluster-service"]
= Infinispan Cluster Service
:linkattrs:
:cq-artifact-id: camel-quarkus-infinispan-cluster-service
:cq-native-supported: true
:cq-status: Stable
:cq-status-deprecation: Stable
:cq-description: Provides an Infinispan implementation of the Camel Cluster Service SPI
:cq-deprecated: false
:cq-jvm-since: 3.32.0
:cq-native-since: 3.32.0

ifeval::[{doc-show-badges} == true]
[.badges]
[.badge-key]##JVM since##[.badge-supported]##3.32.0## [.badge-key]##Native since##[.badge-supported]##3.32.0##
endif::[]

Provides an Infinispan implementation of the Camel Cluster Service SPI

[id="extensions-infinispan-cluster-service-maven-coordinates"]
== Maven coordinates

https://{link-quarkus-code-generator}/?extension-search=camel-quarkus-infinispan-cluster-service[Create a new project with this extension on {link-quarkus-code-generator}, window="_blank"]

Or add the coordinates to your existing project:

[source,xml]
----
<dependency>
    <groupId>org.apache.camel.quarkus</groupId>
    <artifactId>camel-quarkus-infinispan-cluster-service</artifactId>
</dependency>
----
ifeval::[{doc-show-user-guide-link} == true]
Check the xref:user-guide/index.adoc[User guide] for more information about writing Camel Quarkus applications.
endif::[]

[id="extensions-infinispan-cluster-service-additional-camel-quarkus-configuration"]
== Additional Camel Quarkus configuration

[id="extensions-infinispan-cluster-service-configuration-having-only-a-single-consumer-in-a-cluster-consuming-from-a-given-endpoint"]
=== Having only a single consumer in a cluster consuming from a given endpoint

When the same route is deployed on multiple JVMs, it could be interesting to use this extension in conjunction with the xref:reference/extensions/master.adoc[Master one].
In such a setup, a single consumer will be active at a time across the whole camel master namespace.

For instance, having the route below deployed on multiple JVMs:

[source,java]
----
from("master:ns:timer:test?period=100")
    .log("Timer invoked on a single JVM at a time");
----

As a result, a single consumer will be active across the `ns` camel master namespace.
It means that, at a given time, only a single timer will generate exchanges across all JVMs.
In other words, messages will be logged every 100ms on a single JVM at a time.

[id="extensions-infinispan-cluster-service-configuration-infinispan-configuration"]
==== Infinispan Configuration

You can configure the Infinispan client with the various `quarkus.camel.cluster.infinispan` configuration options in `application.properties`.

[source,properties]
----

quarkus.camel.cluster.infinispan.hosts=localhost:11222
quarkus.camel.cluster.infinispan.username=admin
quarkus.camel.cluster.infinispan.password=2s3cr3t

# Optional additional configuration properties
quarkus.camel.cluster.infinispan.configuration-properties."infinispan.client.hotrod.client_intelligence" = BASIC
quarkus.camel.cluster.infinispan.configuration-properties."infinispan.client.hotrod.connect_timeout" = 5000
----


[width="100%",cols="80,5,15",options="header"]
|===
| Configuration property | Type | Default


a|icon:lock[title=Fixed at build time] [[quarkus-camel-cluster-infinispan-enabled]]`link:#quarkus-camel-cluster-infinispan-enabled[quarkus.camel.cluster.infinispan.enabled]`

Whether an Infinispan Cluster Service should be automatically configured according to
'quarkus.camel.cluster.infinispan.++*++' configurations.
| `boolean`
| `true`

a| [[quarkus-camel-cluster-infinispan-id]]`link:#quarkus-camel-cluster-infinispan-id[quarkus.camel.cluster.infinispan.id]`

The cluster service ID.
| `string`
| 

a| [[quarkus-camel-cluster-infinispan-order]]`link:#quarkus-camel-cluster-infinispan-order[quarkus.camel.cluster.infinispan.order]`

The service lookup order/priority.
| `int`
| 

a| [[quarkus-camel-cluster-infinispan-attributes-attributes]]`link:#quarkus-camel-cluster-infinispan-attributes-attributes[quarkus.camel.cluster.infinispan.attributes."attributes"]`

The custom attributes associated to the service.
| `Map<String,String>`
| 

a| [[quarkus-camel-cluster-infinispan-configuration-uri]]`link:#quarkus-camel-cluster-infinispan-configuration-uri[quarkus.camel.cluster.infinispan.configuration-uri]`

The Infinispan configuration URI. Can be used to specify a custom Infinispan configuration file.
| `string`
| 

a| [[quarkus-camel-cluster-infinispan-hosts]]`link:#quarkus-camel-cluster-infinispan-hosts[quarkus.camel.cluster.infinispan.hosts]`

The Infinispan server hosts (e.g., "localhost:11222").
| `string`
| 

a| [[quarkus-camel-cluster-infinispan-secure]]`link:#quarkus-camel-cluster-infinispan-secure[quarkus.camel.cluster.infinispan.secure]`

Enable secure connections to an Infinispan server.
| `boolean`
| 

a| [[quarkus-camel-cluster-infinispan-username]]`link:#quarkus-camel-cluster-infinispan-username[quarkus.camel.cluster.infinispan.username]`

Username for authentication with the Infinispan server.
| `string`
| 

a| [[quarkus-camel-cluster-infinispan-password]]`link:#quarkus-camel-cluster-infinispan-password[quarkus.camel.cluster.infinispan.password]`

Password for authentication with the Infinispan server.
| `string`
| 

a| [[quarkus-camel-cluster-infinispan-sasl-mechanism]]`link:#quarkus-camel-cluster-infinispan-sasl-mechanism[quarkus.camel.cluster.infinispan.sasl-mechanism]`

SASL mechanism for authentication (e.g., DIGEST-MD5, PLAIN, SCRAM-SHA-256).
| `string`
| 

a| [[quarkus-camel-cluster-infinispan-security-realm]]`link:#quarkus-camel-cluster-infinispan-security-realm[quarkus.camel.cluster.infinispan.security-realm]`

Security realm for authentication.
| `string`
| 

a| [[quarkus-camel-cluster-infinispan-security-server-name]]`link:#quarkus-camel-cluster-infinispan-security-server-name[quarkus.camel.cluster.infinispan.security-server-name]`

Security server name for authentication.
| `string`
| 

a| [[quarkus-camel-cluster-infinispan-configuration-properties-configuration-properties]]`link:#quarkus-camel-cluster-infinispan-configuration-properties-configuration-properties[quarkus.camel.cluster.infinispan.configuration-properties."configuration-properties"]`

Additional configuration properties for the Infinispan client.
| `Map<String,String>`
| 

a| [[quarkus-camel-cluster-infinispan-lifespan]]`link:#quarkus-camel-cluster-infinispan-lifespan[quarkus.camel.cluster.infinispan.lifespan]`

Lifespan for entries in the cluster view cache.
| `long`
| `30`

a| [[quarkus-camel-cluster-infinispan-lifespan-time-unit]]`link:#quarkus-camel-cluster-infinispan-lifespan-time-unit[quarkus.camel.cluster.infinispan.lifespan-time-unit]`

Time unit for lifespan (e.g., SECONDS, MINUTES, HOURS).
| `nanoseconds`, `microseconds`, `milliseconds`, `seconds`, `minutes`, `hours`, `days`
| `seconds`
|===

[.configuration-legend]
{doc-link-icon-lock}[title=Fixed at build time] Configuration property fixed at build time. All other configuration properties are overridable at runtime.

