繁体   English   中英

Mule缓存-到期

[英]Mule Cache - Expiry

如何设置setup子中的缓存项的到期时间? 我在传入的请求上设置基于keyExpression的缓存,如下所示:

   <ee:object-store-caching-strategy name="UserAuth-CachingStrategy" keyGenerationExpression="#[message.inboundProperties.'authorization']" doc:name="Caching Strategy">

缓存应该命中外部WS,结果应该缓存5分钟。 如果我用TTL设置“内存中”存储时间(假设是5分钟),则m子不接受此请求。 不管TTL中的值如何,每3-4个请求,m子都会始终击中实际的外部ws。 如果我没有为TTL设置任何值,则缓存永不过期。 我如何为m子中的“内存中”缓存正确设置缓存?

谢谢

如果您使用的是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>

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM