简体   繁体   English

自定义缓存m的目的

[英]Purpose of Custom cache mule

Mule got inbuild object stores to cache data, But what is the purpose of using custom object stores under caching strategies? Mule获得了内置对象存储来缓存数据,但是在缓存策略下使用自定义对象存储的目的是什么? If possible, Please mention a usecase. 如果可能,请提及一个用例。

Custom object stores are useful when you want to use a custom persistence mechanism for your ObjectStore's 当您想对ObjectStore的对象使用自定义持久性机制时,自定义对象存储非常有用

By default Mule provides two implementations, in-memory and a file based persistent store. 默认情况下,Mule提供两种实现,即内存和基于文件的持久性存储。

One possible use-case is, if you use Enterprise Edition have clustering enabled, you also have the ability to share these stores across multiple Mule nodes. 一种可能的用例是,如果使用Enterprise Edition启用了群集,则还可以在多个Mule节点之间共享这些存储。 However if you do not use EE or clustering but still want to share data between multiple Mule's, then you will need to use a persistent object store that can be shared across multiple mule nodes. 但是,如果您不使用EE或群集,但仍想在多个Mule之间共享数据,则将需要使用可在多个Mule节点之间共享的持久对象存储。

The ObjectStore interface has many implementations so you can choose a persistence mechanism that best suits you. ObjectStore接口具有许多实现,因此您可以选择最适合您的持久性机制。 Examples include Redis, Ehcache, Mongo, Cassandra, JDBC. 示例包括Redis,Ehcache,Mongo,Cassandra,JDBC。 More on this here: http://java.dzone.com/articles/synchronizing-data-across-mule 有关更多信息,请参见http : //java.dzone.com/articles/synchronizing-data-across-mule

Ryan has given the correct explanation.. I just want to add:- Mule uses object stores whenever it needs data to persist for later retrieval. Ryan给出了正确的解释。我只想补充:-Mule在需要数据持久存储以供以后检索时使用对象存储。

Custom Object store can be configure using Java classes and you can customize the Object store as per your need.. 可以使用Java类配置自定义对象存储,并且您可以根据需要自定义对象存储。
You can customize it and control your Cache and the Cache Keys, as well as store and retrieve the data, log you Cache keys and Cache contents, list you Cache keys etc from the Java class and that means full control on the Custom Object store .. Please go through the following links :- 您可以自定义它并控制Cache和Cache Key,以及存储和检索数据,从Java类中记录Cache密钥和Cache内容,列出Cache密钥等,这意味着对Custom Object store拥有完全控制权。请通过以下链接:

http://ricston.com/blog/cache-scope-ehcache/ http://ricston.com/blog/cache-scope-ehcache/

http://java.dzone.com/articles/cache-scope-ehcache http://java.dzone.com/articles/cache-scope-ehcache

http://www.mulesoft.org/documentation/display/current/Mule+Object+Stores http://www.mulesoft.org/documentation/display/current/Mule+Object+Stores

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

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