简体   繁体   中英

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? If possible, Please mention a usecase.

Custom object stores are useful when you want to use a custom persistence mechanism for your ObjectStore's

By default Mule provides two implementations, in-memory and a file based persistent store.

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. 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.

The ObjectStore interface has many implementations so you can choose a persistence mechanism that best suits you. Examples include Redis, Ehcache, Mongo, Cassandra, JDBC. More on this here: 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.

Custom Object store can be configure using Java classes and you can customize the Object store as per your need..
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 :-

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

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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