Configuration

The configuration of all types of caches in Cúram Cache is entirely declarative and it is based on the configuration mechanism provided by the application. Cache configuration parameters must be added to the APP_CACHE property section.

In the current implementation, global caches support both size and time based eviction policies while the multi-instance caches have support only for time based eviction policy.

The following cache configuration parameters can be adjusted:

All cache configuration properties must conform to this notation:

curam.cache.<cache_group_name>.<cache_name>.<parameter>

where:

In the example below, the global cache curam.myproject.mycache in the default global cache group curam-group is configured with a size of 1000 items and an eviction policy of Least Recently Used.

Figure 1. Configuring a cache
curam.cache.curam-group.curam.myproject.mycache.size=1000
curam.cache.curam-group.curam.myproject.mycache.evictionPolicy=LRU

In this second example, the transaction local cache curam.myproject.mycache in the transaction local cache group transaction-group is configured with a time to idle of 10 seconds while all other transaction local caches are configured with a value of 5 seconds.

Figure 2. Configuring all caches in a group
curam.cache.transaction-group.curam.myproject.mycache
                                          .timeToIdle=10
curam.cache.transaction-group.*.timeToIdle=5

Cache configuration data stored in the application configuration repository can be overridden by passing the relevant values as JVM system properties. This might be of interest for batch processes where the application profile might be different than the online application.

The example below shows how to disable the global cache curam.myproject.mycache in the default global cache group for a batch process.

Figure 3. Disabling a cache for a batch process
ant -f app_batchlauncher.xml 
     -Dcuram.cache.curam-group.curam.myproject.mycache.size=0 
     -Dbatch.userna…