Skip to content

Latest commit

 

History

History
36 lines (23 loc) · 1.32 KB

README.md

File metadata and controls

36 lines (23 loc) · 1.32 KB

Infinispan with Vaadin example

This is an example app how one can use Infinispan as a persistency layer for Vaadin app. Wildfly and its provided service is used.

Steps to play around with this app:

1. Add "datasource" to Wildfly

Whatever wildfly config you are using, add an Infinispan cache for this demo. E.g. add following lines to standalone-full-ha.xml, under <subsystem xmlns="urn:jboss:domain:infinispan:2.0"> section :

<cache-container name="myCache" default-cache="cachedb">
    <local-cache name="cachedb"/>
</cache-container>

To use the replicated mode in a cluster following configuration works fine:

<cache-container name="myCache" default-cache="cachedb">
    <transport lock-timeout="60000"/>
    <replicated-cache name="cachedb" batching="true" mode="SYNC"/>
</cache-container>

Refer to Infinispan and Wildfly docs for more configuration options. You can for example configure disk storage for "backup" to survive from cluster wide reboots. There are also numerous options how you can fine tune data replication or use "distribution" that will scale better in large clusters.

2. Start Wildfly

The perfect setup depends on your setup, but e.g. issue following command from wildfly home

./bin/standalone.sh --server-config=standalone-full-ha.xml

3. Build and deploy

mvn install wildfly:deploy