Search code examples
cachingmulemule-componentcloudhubmule-cluster

Shared cache between workers in Cloudhub?


From what I see in the official cache scope documentation, if managed-object-store is used with appropriate values - cache is supposed to be shared between multiple workers/nodes in Cloudhub.

<ee:object-store-caching-strategy name="Caching_Strategy" keyGenerationExpression="#[flowVars.address_id + flowVars.count]" doc:name="Caching Strategy">
        <managed-store storeName="CacheStore" persistent="true" maxEntries="${cache.max.entries}" entryTTL="${cache.ttl}" expirationInterval="${cache.expiration.poll}"/>
</ee:object-store-caching-strategy>

But this is not working as expected. The cache entries aren't being shared. Each worker/node seems to creating its on cache store.

I tried a few combinations like making store persistent or decreasing expirationPoll to a few millis or making queues persistent and so on. No joy.

Your help is much appreciated.

Using Mule Runtime 3.8.4.


Solution

  • Cache Scope is designed to be used per worker and only as side cache pattern. For shared cache you'd need to for some kind of cluster cache solution. We eneded up going with Hazelcast.