如何为骡子中的缓存条目设置过期时间?我正在根据传入的请求设置一个基于keyExpression的缓存,如下所示:
<ee:object-store-caching-strategy name="UserAuth-CachingStrategy" keyGenerationExpression="#[message.inboundProperties.'authorization']" doc:name="Caching Strategy">缓存应该访问外部WS,结果应该缓存5分钟。如果我在内存中设置了一个TTL存储,比如说5分钟,骡子就不会满足这个请求。不管TTL中的值如何,mule总是每3-4次访问实际的外部ws。如果我没有为TTL设置任何值,那么缓存就永远不会过期。如何正确地为骡子中的“内存”缓存设置缓存?
谢谢
发布于 2015-03-10 03:34:18
如果您使用的是ObjectStore,您可以很容易地按照如下所示的方式使用spring属性并将缓存策略引用到它:- http://ricston.com/blog/cache-scope-ehcache/
您还可以使用托管存储如下:
<ee:object-store-caching-strategy nname="UserAuth-CachingStrategy" keyGenerationExpression="#[message.inboundProperties.'authorization']" doc:name="Caching Strategy">
<managed-store storeName="myNonPersistentManagedObjectStore" maxEntries="-1" entryTTL="20000" expirationInterval="5000"/>
</ee:object-store-caching-strategy>https://stackoverflow.com/questions/28953171
复制相似问题