Making a searchable IData cache.

Making a searchable IData cache.

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:

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:

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

Working at i8c

i8c is a system integrator that strives for an informal atmosphere between its employees, who have an average age of approx 30 years old. We invest a lot of effort in the professional development of each individual, through a direct connection between the consultants and the management (no multiple layers of middle management). We are based in Kontich, near Antwerp, but our customers are mainly located in the triangle Ghent-Antwerp-Brussels and belong to the top 500 companies in Belgium (Securex, Electrabel, UCB, etc…).

Quality Assurance

i8c is committed to delivering quality services and providing customer satisfaction. That’s why we invested in the introduction of a Quality Management System, which resulted in our ISO9001:2000 certification. This guarantees that we will meet your expectations, as a reliable, efficient and mature partner for your SOA & integration projects.

i8c - ISO9001-2015