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
Over 2 million developers have joined DZone.
Log In / Join
Please enter at least three characters to search
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Zones

Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

Modernize your data layer. Learn how to design cloud-native database architectures to meet the evolving demands of AI and GenAI workkloads.

Secure your stack and shape the future! Help dev teams across the globe navigate their software supply chain security challenges.

Releasing software shouldn't be stressful or risky. Learn how to leverage progressive delivery techniques to ensure safer deployments.

Avoid machine learning mistakes and boost model performance! Discover key ML patterns, anti-patterns, data strategies, and more.

Trending

  • Chaos Engineering for Microservices
  • Zero Trust for AWS NLBs: Why It Matters and How to Do It
  • How to Build Scalable Mobile Apps With React Native: A Step-by-Step Guide
  • A Modern Stack for Building Scalable Systems

How to Use ObjectStore in Mule

A developer provides a quick and easy tutorial on how to work with ObjectStore from your Mule palette to create persistent data.

By 
Prince Pratap Singh user avatar
Prince Pratap Singh
·
Dec. 30, 20 · Tutorial
Likes (4)
Comment
Save
Tweet
Share
27.5K Views

Join the DZone community and get the full member experience.

Join For Free

1. Introduction 

Object stores are used to store an object. Mule uses object stores whenever it needs to persist data  for later retrieval. Mule uses object stores internally by utilizing a key value pair combination. It is already available in the Mule palette – from there we can directly use it. If it is not available in your Mule palette, you can get it from the Mule Exchange Portal.

2. Operations Available 

An object store contains the following operations in the form of connectors in the Mule palette:

  • Clear: Removes all the contents in the store.
  • Contains: Returns whether the key is present or not.
  • Remove: Removes the values associated to the given key.
  • Retrieve: Retrieves the stored data for the given key.
  • Retrieve all: Retrieves all the key value pairs in the ObjectStore.
  • Retrieve all keys: Returns a List containing all keys that the ObjectStore currently holds.
  • Store: Stores the given value using the given key.

3. Types of ObjectStore

  • Persistent: This is the default option for the ObjectStore. By using this option, stored data stays in the system even if the system or its runtime is down.
  • In-Memory: Though this functionality is not available explicitly, it can be selected. By not selecting the persistent option, ObjectStore, by default, becomes in-memory. This means that data is available only when the runtime is up.

4. Implementing a Demo ObjectStore (Storing and Retrieval)

Store

  1. Drag and drop the ObjectStore: Storeconnector from the Mule Palette. 
  2. Configure the connector properties as per the screenshot below. 
  3. Create global configurations as per the screenshot below
  4. Click Ok and your ObjectStore: Store connector is ready!

Retrieve

  1. Drag and drop the ObjectStore: Retrieve connector from the Mule palette.
  2. Retrieve the data from ObjectStore by using a key.
  3. Check that the data is using a set payload or logger.
  4. Testing: Hit API.
ObjectStore

Opinions expressed by DZone contributors are their own.

Partner Resources

×

Comments
Oops! Something Went Wrong

The likes didn't load as expected. Please refresh the page and try again.

ABOUT US

  • About DZone
  • Support and feedback
  • Community research
  • Sitemap

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 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends:

Likes
There are no likes...yet! 👀
Be the first to like this post!
It looks like you're not logged in.
Sign in to see who liked this post!