Since v8.2 we have access to Terracotta caching (Ehcache) using the pub.cache services. This is a great addition, however when working with them you’ll notice they’re still very low level java-based. Putting something in them requires java objects for both the keys and the objects. When working on the Integration Server this can be a bit of a pain. Luckily the IData structure (the pipeline) is a java object. For basic puts and gets it all works fine. However when you truly want to use the cache through searches, things become a bit more complicated.

You need to enable your cache for searching. You do this by defining a “searchable” tag inside your cache config file or through the admin gui if you are running v9.5+. The result would be the same:

<ehcache name="CacheTest" updateCheck="false">
  <diskStore path="./cacheStore/CacheTest"/>
  <defaultCache maxEntriesLocalHeap="0">
    <elementValueComparator class=""/>
        <cache name="Pois" eternal="true" maxEntriesLocalHeap="2000" cacheLoaderTimeoutMillis="30000">
          <persistence strategy="localrestartable"/>
          <elementValueComparator class=""/>
            <searchAttribute name="name" class="" properties="path=Poi/name"/>
             <searchAttribute name="longitude" class="" properties="path=Poi/location/lon"/>
            <searchAttribute name="latitude" class="" properties="path=Poi/location/lat"/>

Next you will need to tell the cache which attributes are searchable. You can do this by adding searchAttributes. By default ehcache comes with AttributeExtractors that can automatically can take on POJO’s which is great…if you work in plain java. However when working on the Integration Server your data structure is IData and unfortunately there’s no IData AttributeExtractor out-of-the-box. Making one isn’t so hard:

public class IDataAttributeExtractor implements AttributeExtractor {

    private final String path;

    public IDataAttributeExtractor(Properties props) throws InvalidConfigurationException {

        this.path = props.getProperty("path");
        if (path == null || path.equals(""))
            throw new InvalidConfigurationException("Invalid path given: " + path);

    public Object attributeFor(Element element, String attribute) throws AttributeExtractorException {

        IData idata = (IData) element.getObjectValue();
        Object result = IDataWmPathProcessor.getNode(idata, path);
        return result;


If you’re on v8.2 you’ll still need to create a search flow to query your IData that’s in the cache. If you’re on v9.5+ you can use the search flow that comes with WmPublic. So things are certainly evolving, but it would be great if such an IData AttributeExtractor would come out-of-the-box and fully supported, so please vote for the brainstorm ticket (Feature Request #02422).

Author: Stefan De Wandeleir