drools-reliability/README.md
drools-reliability is a module to make a stateful KieSession reliable or in other words to allow to resume the state of a session after a JVM crash.
It has a pluggable persistence layer with currently one implementation backed by Infinispan.
drools-reliability-core and drools-reliability-infinispan as dependencies to your project <dependency>
<groupId>org.drools</groupId>
<artifactId>drools-reliability-core</artifactId>
</dependency>
<dependency>
<groupId>org.drools</groupId>
<artifactId>drools-reliability-infinispan</artifactId>
</dependency>
KieSession with PersistedSessionOption.newSessionKieSessionConfiguration conf = KieServices.get().newKieSessionConfiguration();
conf.setOption(PersistedSessionOption.newSession(PersistedSessionOption.Strategy.STORES_ONLY));
KieSession ksession = kbase.newKieSession(conf, null);
long savedSessionId = session.getIdentifier();
savedSessionId at the client application side. It is used to resume the session after a JVM crash.PersistedSessionOption.fromSession and savedSessionId. The created ksession will resume from the last saved state.KieSessionConfiguration conf = KieServices.get().newKieSessionConfiguration();
conf.PersistedSessionOption.fromSession(savedSessionId, PersistedSessionOption.Strategy.STORES_ONLY));
KieSession ksession = kbase.newKieSession(conf, null);
long savedSessionId = session.getIdentifier();
drools.reliability.storage.infinispan.mode
mvn test -Premoteorg.drools.reliability.example.RemoteCacheManagerExample.drools.reliability.storage.infinispan.allowedpackages
(EMBEDDED mode only) drools.reliability.storage.infinispan.directory
global/state(REMOTE mode only) drools.reliability.storage.infinispan.remote.host
(REMOTE mode only) drools.reliability.storage.infinispan.remote.port
(REMOTE mode only) drools.reliability.storage.infinispan.remote.user
(REMOTE mode only) drools.reliability.storage.infinispan.remote.pass
PersistedSessionOption.Strategy