Software AG Products 10.7 | Integrate Software AG Products Using Digital Event Services | webMethods Task Engine User’s Guide | Configuring the Task Engine Environment | Configuring Task Engine in My webMethods | Creating a Task Time-to-Live Eviction Policy
 
Creating a Task Time-to-Live Eviction Policy
You can create a Time-to-Live (TTL) eviction policy for My webMethods Server caches to remove tasks based on the last used object date. This policy enables automatic shrinkage of caches by removing completed tasks that are no longer being accessed, thus allowing more space for active tasks in the cache. To configure a TTL eviction policy, you must add the following setting to "TaskDataCache" and "Thing Cache" in the cache.xml. To do so:
1. Obtain the cache.xml configuration file by running the following command: MWS/bin/mws.bat|sh getconfig cache.xml
This saves a local copy of cache.xml to MWS/server/default/config.
2. Open /MWS/server/default/config/cache.xml and edit the following cache configuration attributes in "TaskDataCache" and "Thing Cache" in the cache.xml file:
*lastAccessedEvictionPolicy="true"
*timeToLive="seconds"
3. Save the file.
4. Upload cache.xml back to the database by running the following command: MWS/bin/mws.bat|sh putconfig cache.xml
This setting specifies that if an entry is not accessed in the cache for the specified number of seconds, then it will be automatically evicted from the cache. For example, to set a 24 hour eviction policy:
<cache name="Thing Cache"
class="com.webmethods.portal.service.meta2.impl.ThingTransientCache"
maxSize="10000"
isClustered="true"
timeToLive="86400"
lastAccessedEvictionPolicy="true"
ID= "1"
enabled="true"/>
<cache name="TaskDataCache"
class="com.webmethods.portal.service.cache.impl.TransientCache"
maxSize="10000"
isClustered="true"
timeToLive="86400"
lastAccessedEvictionPolicy="true"
ID="12"
enabled="true"/>