Monday 1 October 2018

Mule Object Stores


An object store is a facility for storing objects in Mule. Mule uses object stores whenever it needs data to persist for later retrieval. Internally, Mule uses object stores in various filters, routers, and other message processors that need to store state between messages. In most cases, Mule creates and manages object stores automatically, so no user configuration is necessary.

Use Cases

In most cases, Mule creates and manages object stores for you, so no configuration is necessary. However, you may explicitly configure an object store in the following cases:
·         When configuring an idempotent message filter or until a successful scope occurs.
·         When configuring a custom component that must use an object store to persist information.
·         When storing or retrieving information from a Mule flow through the Object Store module, available as an extension.
Mule provides two types of object stores:
·         In-memory store – Prior to Mule 3.5.0, in-memory store was the default. As of Mule 3.5.0, persistent store is the default. For more information, see "Object Stores and Clustering" in the Cache Scope document.
·         Persistent store – Mule persists data when an object store is explicitly configured to be persistent. Mule creates a default persistent store in the file system.

Adding Object Store Components

1.     Install the Object Store component available in Anypoint Exchange

This starts an installation Wizard. Select "ObjectStore Connector (Mule 3.6+)", click "Next", then "Next" again. Accept the terms of the license agreement and click "Finish".

Operation
Description
All keys
Returns a list of all the keys in the object store.
Contains
Checks whether the object store contains the given key.
Dual store
Stores a value using key, and also store key using value.
Remove
Remove the object for the respective key.
Retrieve
Retrieve an object from the object store and make it available in the specified property scope of a Mule Message.
Retrieve store
Retrieve and Store in the same operation.
Retrieve with lock
Retrieve the given object with lock from the object store and make it available in the specified property scope of a Mule Message.
Store
Stores an object in the object store.


 

Cloudhub: In application data we can see object store in bellow.


No comments:

Post a Comment