@Rhalsnad, Deployment Cache (in memory) was introduced to avoid polling the database every time a process definition is needed.
Reference: Deployment Cache | docs.camunda.org
You can customize the maximum Capacity of the Cache like below:
<bean id="processEngineConfiguration" class="org.camunda.bpm.engine.impl.cfg.StandaloneInMemProcessEngineConfiguration">
<!-- Your property definitions! -->
....
<property name="cacheCapacity" value="120" />
</bean>
The default value is 1000 . When the process engine is created, this property will be set and all resources will be scanned and deployed accordingly.
By changing the maximum capacity, the configuration effects all of the following cache components:
- Process definition
- Case definition
- Decision definition
- Decision requirements definition
Provide a custom Cache Implementation by implementing the Cache interface from org.camunda.util.commons package and then plug in you cache implementation into a custom CacheFactory
public class MyCacheImplementation<K, V> implements Cache<K, V> {
// implement interface methods and your own cache logic here
}
public class MyCacheFactory extends CacheFactory {
@Override
public <T> Cache<String, T> createCache(int maxNumberOfElementsInCache) {
return new MyCacheImplementation<String, T>(maxNumberOfElementsInCache);
}
}
Custom cache factory configuration:
<bean id="processEngineConfiguration" class="org.camunda.bpm.engine.impl.cfg.StandaloneInMemProcessEngineConfiguration">
<!-- Your property definitions! -->
....
<property name="cacheFactory">
<bean class="org.camunda.bpm.engine.test.api.cfg.MyCacheFactory" />
</property>
</bean>
Package: org.camunda.commons.utils.cache
Interface: Cache.java
<dependency>
<groupId>org.camunda.commons</groupId>
<artifactId>camunda-commons-utils</artifactId>
<version>1.9.0</version>
</dependency>