Quarkus - Infinispan Embedded

Infinispan is an elastically scalable in-memory data store that you can embeddirectly in your application.

Check out the Infinispandocumentation 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:

  1. ./mvnw quarkus:add-extension -Dextensions="infinispan-embedded"

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

  1. <dependency>
  2. <groupId>io.quarkus</groupId>
  3. <artifactId>quarkus-infinispan-embedded</artifactId>
  4. </dependency>

Feature Support

The Infinispan embedded extension offers core caching functionality thatincludes clustered caches, off-heap memory, data persistence, and transactions.

The Infinispan embedded extension does not currently support indexingcapabilities.

Transactions

Configure Infinispan caches for transactional operations with a specificTransactionManagerLookup, as follows:

  1. <local-cache name="quarkus-transaction">
  2. <transaction transaction-manager-lookup="org.infinispan.transaction.lookup.JBossStandaloneJTAManagerLookup"/>
  3. </local-cache>

For more information, see the Quarkus 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 nothave to configure and start caches manually.

Additional injection functionality will be available in future versions.
  • EmbeddedCacheManager
  • This is the main entry point to configure and obtain caches.

Configuration Reference

Configuration property fixed at build time - ️ Configuration property overridable at runtime

Configuration propertyTypeDefault
quarkus.infinispan-embedded.xml-configThe configured Infinispan embeddex xml file which is used by the managed EmbeddedCacheManager and its Cachesstring
JMX elements are disabled during native runtime so you can use the sameconfiguration file in JVM and native modes.