DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Newsletter
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Related

  • Testing Business Programs Without Constructing Domain Objects
  • Momento Migrates Object Cache as a Service to Ampere® Altra®
  • Why I Ditched Redis for Cloudflare Durable Objects in My Rate Limiter
  • Real-Object Detection at the Edge: AWS IoT Greengrass and YOLOv5

Trending

  • Your Event Storming Is Not Your Software Design
  • Google Cloud KMS vs. AWS KMS: Java Encryption Guide
  • Two Engines, One Query: DuckDB Inside Neo4j
  • The Man Who Invented Selenium Also Built Its Replacement

Draft This article hasn't been published, so readers can't see it.

In moderation This article is waiting for review, so readers can't see it yet.

Deleted This article has been deleted, so readers can't see it.

  1. DZone
  2. Coding
  3. Languages
  4. Working With Object Store in Mule, Part 1

Working With Object Store in Mule, Part 1

In this first part of this series, we explore the concept of object stores and persistent stores, and how they relate to Mule apps.

By 
Ankit Lawaniya
·
Feb. 03, 18 · Analysis
Post on X (opens in a new tab) Share on LinkedIn (opens in a new tab)
11.2K Views

Join the DZone community Save articles, join the discussion, and download Refcards and Trend Reports with a free account.

Join for free Already a member? Log in

Mule Object Store

An Object Store Connector is one of the most useful connectors provided in the Mule runtime. It is used for storing the state of the application and can be shared across applications. Mule uses object stores whenever it needs data to persist for later retrieval. It is a convenient way to store objects for later retrieval by key, essentially a key-value, store. By default, this is in-memory, but it can also be easily changed to persist to file.

Why Object Stores?

We often get the requirement where we need some application data to be used and shared across multiple applications. Though we can easily use a database for this purpose, where we have to query our DB to get this data, the disadvantage of this approach is whenever we need data we need to query our database. We can also use Object Store in Mule to make this a little easier.

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

How to Download Object Store Connector

To use the Object Store module in Anypoint Studio, we must first download the Object Store Connector from the Anypoint Exchange. Alternatively, you can install it from Anypoint Studio.

Download Connector from the Anypoint Exchange:

Image title

Download Connector through Anypoint Studio:

Image title

Use Cases

In most cases, Mule creates and manages object stores automatically, 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, this is available as an extension.

Mule Provides Two Types of Object Stores:

  • In-memory store –  Stores objects in local Mule runtime memory. Objects are lost on the shutdown of the Mule runtime. Prior to Mule 3.5.0, in-memory store was the default. As of Mule 3.5.0, persistent store is the default.

  • 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. In a standalone Mule runtime, Mule creates a default persistent store in the file system.

In the Next Post…

With these basics in mind, our next post, Working With Object Store in Mule - Part 2, we will see the operations supported by Object Store and how can we use them in an application.

Hope this helps, thanks!

Keep learning!

Object (computer science)

Opinions expressed by DZone contributors are their own.

Related

  • Testing Business Programs Without Constructing Domain Objects
  • Momento Migrates Object Cache as a Service to Ampere® Altra®
  • Why I Ditched Redis for Cloudflare Durable Objects in My Rate Limiter
  • Real-Object Detection at the Edge: AWS IoT Greengrass and YOLOv5

Partner Resources

×

Comments

Loading comments

The comments didn't load

Please try again in a moment.

Likes

Loading

The next likes didn't load. Please try again.

The likes didn't load

Please try again in a moment.

See who liked this

Log in or join DZone for free to see who liked this article.

Log in Join for free
  • RSS
  • X
  • Facebook

ABOUT US

  • About DZone
  • Support and feedback
  • Community research

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 215
  • Nashville, TN 37211
  • [email protected]

Let's be friends:

  • RSS
  • X
  • Facebook