////
This guide is maintained in the main Quarkus repository
and pull requests should be submitted there:
https://github.com/quarkusio/quarkus/tree/master/docs/src/main/asciidoc
////
include::./attributes.adoc[]
= Quarkus - Infinispan Embedded
Infinispan is an elastically scalable in-memory data store that you can embed
directly in your application.

Check out the link:https://infinispan.org/documentation/[Infinispan
documentation] to find out more about the Infinispan project.

== Adding the Infinispan Embedded Extension
After you set up your Quarkus project, run the following command from the base directory:

[source]
----
./mvnw quarkus:add-extension -Dextensions="infinispan-embedded"
----

The command adds the following dependency to your `pom.xml`:

[source,xml]
----
<dependency>
    <groupId>io.quarkus</groupId>
    <artifactId>quarkus-infinispan-embedded</artifactId>
</dependency>
----

== Feature Support
The Infinispan embedded extension offers core caching functionality that
includes clustered caches, off-heap memory, data persistence, and transactions.

[NOTE]
====
The Infinispan embedded extension does not currently support indexing
capabilities.
====

=== Transactions
Configure Infinispan caches for transactional operations with a specific
`TransactionManagerLookup`, as follows:

[source,xml]
----
<local-cache name="quarkus-transaction">
   <transaction transaction-manager-lookup="org.infinispan.transaction.lookup.JBossStandaloneJTAManagerLookup"/>
</local-cache>
----

For more information, see the Quarkus link:transaction.html[Transaction Guide].

=== Native Limitations
When running Infinispan in native mode, some limitations apply:

* JMX management is not supported.
+ GraalVM does not allow native VM interfaces.
* `UDP`/`Multicast` is not supported.
+ You must use `TCP` transport and a non-UDP based membership protocol with JGroups.

== Injection (CDI)
The Infinispan embedded extension provides injection capabilities so you do not
have to configure and start caches manually.

[NOTE]
====
Additional injection functionality will be available in future versions.
====

`EmbeddedCacheManager`::
This is the main entry point to configure and obtain caches.

== Configuration Reference

include::{generated-dir}/config/quarkus-infinispan-embedded.adoc[opts=optional, leveloffset=+1]

[TIP]
====
JMX elements are disabled during native runtime so you can use the same
configuration file in JVM and native modes.
====
