簡體   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