This document provides an overview of Mule object stores, including their uses, types, and how to configure custom object stores. Mule uses object stores to persist state between messages in filters, routers, and processors. Object stores can be in-memory, persistent to filesystem, or persistent across redeployments in cloud environments. The object store connector allows storing, retrieving, listing and removing data from an object store. Custom object stores can be implemented by extending interface and classes.
Convert to study materialsBETA
Transform any presentation into ready-made study materialselect from outputs like summaries, definitions, and practice questions.
2. OBJECT STORE
It facilitates storing of objects for later retrieval.
In most cases mule creates and manages object stores.
You can explicitly configure an object store based on requirement.
Mule uses object store in various filters, routers, and message processors
that need to store their state between messages.
We can create our custom stores as well for persisting objects.
3. USE CASES
Idempotent filter.
until a successful scope.
Cache scope
Aggregator (built-in object store or create own reference)
A custom component that requires storage of objects to persist
information
Storing or retrieving objects from objectstore Connector
4. TYPES OF OBJECT STORE
In-memory Store: stores object in local mule runtime memory
and objects are lost on shutdown of mule runtime.
Persistant store: mule persists the data when an object store is
explicitly configured to be persistant
In standalone mule runtime mule by default creates a persistant
store in filesystem
In Runtime Manager object store survives across redeployments
as objects are stored in cloud but not in worker.
5. OBJECT STORE CONNECTOR
The connector provides operations to store, retrieve, list, and
remove data from a Object Store.
Install object store connector from exchange
Create a global configuration for objectstore
<objectstore:config>
refer to the global object store and perform operations using
objectstore connector
Operations like store,retrieve,contains,remove
6. SPRING BEAN INSTANCES
Mule includes three default object stores instantiated every time you run
mule both on premises and on Runtime Manager.
_defaultInMemoryObjectStore
_defaultUserObjectStore
_defaultTransientUserObjectStore
For cloudhub implementation of object stores we use
_defaultUserObjectStore
7. CUSTOM OBJECT STORE
Create your own object store by Implementing
org.mule.api.store.ObjectStore Interface and override standard
implementation of object stores like
org.mule.api.store.ListableObjectStore
org.mule.api.store.PartitionableObjectStore
org.mule.api.store.PartitionableExpirableObjectStore