Spring Infinispan Integration on Wildfly
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src/main updates Sep 17, 2016
.gitignore
README.md Update README.md Sep 19, 2016
pom.xml

README.md

Spring Infinispan Integration on Wildfly

This is a sample spring boot application that demonstrates Infinispan caching integration on Wildfly servers. It works for both local and distributed caching on both standalone and clustered Wildfly instances.

This application is tested on Wildfly 10.1.0.Final.

Running the application

The application war file can be built using maven.

    mvn clean install

The application also requires a custom cache container, below is how it can be created on Wildfly.

Standalone server mode

When running the server in a standalone mode add the following cache container config in standalone.xml file.

    <cache-container name="mycache" aliases="ha-partition" default-cache="default" module="org.wildfly.clustering.server">
        <local-cache name="default" />
    </cache-container>

Clustered server mode

For clustered mode, the server must be run with full-ha profile. And add the following cache container to standalone-full-ha.xml

    <cache-container name="mycache" aliases="ha-partition" default-cache="default" module="org.wildfly.clustering.server">
        <transport lock-timeout="60000"/>
        <replicated-cache name="default" mode="SYNC">
            <transaction mode="BATCH"/>
        </replicated-cache>
    </cache-container>

Usage

The application exposes the following rest endpoints to add, retrieve and remove cache entries

GET /rest/cache/{key}
PUT /rest/cache/{key}/{value}
DELETE /rest/cache/{key}

Resources

Visit the following blog post for more details

Spring and Infinispan Integration on Wildfly Cluster