SlideShare a Scribd company logo
1 of 7
MuleSoft ESB
Sharing Data Across Mule Applications
By
AKASH PRAJAPATI
Scripting Support
Topics :
•Sharing Data Across Mule Applications
Purpose :
- To showcase object store functionality in MuleSoft ESB.
- Using object store, Two different Mule Application shared data.
Pre-requisites :
•Basic under standing of Mule ESB
•JDK 1.8 or above
•Anypoint Studio v 6.2.1 or above
•Mule Server v 3.8.0 EE or above
Details :
(*) Domain Project :
Common resources are placed into this project
(*) Mule Project – 1 :
This Application can store data in the Common Shared Memory – ( Called Object Store )
(*) Mule Project – 2 :
This Application will retrieve all data which are stored in common shared memory – ( Called Object Store )
Flow Details : MULE_DOMAIN_PROJECT
<?xml version="1.0" encoding="UTF-8"?>
<domain:mule-domain
xmlns="http://www.mulesoft.org/schema/mule/core"
xmlns:domain="http://www.mulesoft.org/schema/mule/ee/domain"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:spring="http://www.springframework.org/schema/beans"
xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
xmlns:http="http://www.mulesoft.org/schema/mule/http"
xsi:schemaLocation="
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd
http://www.mulesoft.org/schema/mule/ee/domain http://www.mulesoft.org/schema/mule/ee/domain/current/mule-domain-ee.xsd
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd">
<!-- configure here resource to be shared within the domain -->
<http:listener-config name="HTTP_Listener_Configuration" host="0.0.0.0" port="9091" doc:name="HTTP Listener Configuration" />
<spring:beans>
<spring:bean id="mySimpleMemoryObjectStore" class="org.mule.util.store.SimpleMemoryObjectStore" />
</spring:beans>
</domain:mule-domain>
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns:objectstore="http://www.mulesoft.org/schema/mule/objectstore"
xmlns:json="http://www.mulesoft.org/schema/mule/json"
xmlns:http="http://www.mulesoft.org/schema/mule/http"
xmlns="http://www.mulesoft.org/schema/mule/core"
xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
xmlns:spring="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.mulesoft.org/schema/mule/json http://www.mulesoft.org/schema/mule/json/current/mule-json.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
http://www.mulesoft.org/schema/mule/objectstore http://www.mulesoft.org/schema/mule/objectstore/current/mule-objectstore.xsd">
<objectstore:config name="ObjectStore" objectStore-ref="mySimpleMemoryObjectStore" doc:name="ObjectStore" />
<flow name="mule_app1_projectFlow">
<http:listener config-ref="HTTP_Listener_Configuration" path="/app1/set" doc:name="HTTP" />
<logger level="INFO" message="#['======================= START : APP1 =================================']" doc:name="Logger"/>
<json:json-to-object-transformer returnClass="java.util.HashMap" doc:name="JSON to Object" />
<set-variable variableName="objStrSize" value="#[app.registry.mySimpleMemoryObjectStore.allKeys().size()]" doc:name="Set Count" />
<objectstore:store config-ref="ObjectStore" key="#[new java.lang.Integer(flowVars['objStrSize']+1)]" value-ref="#[payload]" doc:name="Add To ObjectStore"/>
<set-payload value="Payload stored in ObjectStore...!!!" doc:name="Set Payload" />
<!-- <object-to-byte-array-transformer doc:name="Object to Byte Array" /> -->
<logger level="INFO" message="#[payload]" doc:name="Logger"/>
<logger level="INFO" message="#['======================= END : APP1 =================================']" doc:name="Logger"/>
</flow>
</mule>
Flow Details : MULE_APP1_PROJECT
Flow Details : MULE_APP2_PROJECT
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns:objectstore="http://www.mulesoft.org/schema/mule/objectstore"
xmlns:http="http://www.mulesoft.org/schema/mule/http"
xmlns="http://www.mulesoft.org/schema/mule/core"
xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
xmlns:spring="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
http://www.mulesoft.org/schema/mule/objectstore http://www.mulesoft.org/schema/mule/objectstore/current/mule-objectstore.xsd">
<objectstore:config name="ObjectStore" objectStore-ref="mySimpleMemoryObjectStore" doc:name="ObjectStore" />
<flow name="mule_app2_projectFlow">
<http:listener config-ref="HTTP_Listener_Configuration" path="/app2/getall" doc:name="HTTP"/>
<logger level="INFO" message="#['======================= START : APP2 =================================']" doc:name="Logger"/>
<set-variable variableName="varAllData" value="#[new java.util.ArrayList()]" doc:name="Variable - Message Arraylist"/>
<foreach collection="#[app.registry.mySimpleMemoryObjectStore.allKeys()]" doc:name="For Each" counterVariableName="i">
<objectstore:retrieve config-ref="ObjectStore" key="#[new java.lang.Integer(i)]" doc:name="Retrieve Message"/>
<object-to-string-transformer doc:name="Object to String" />
<logger message="Values #[new java.lang.Integer(i)] : #[message.payload]" level="INFO" doc:name="Logger" />
<expression-component doc:name="Add Message to ArrayList">
<![CDATA[flowVars['varAllData'].add(payload)]]>
</expression-component>
</foreach>
<set-payload doc:name="Set Payload" value="#[flowVars['varAllData']] "/>
<logger level="INFO" message="#['==================================']" doc:name="Logger"/>
<logger level="INFO" message="#[payload]" doc:name="Logger"/>
<logger level="INFO" message="#['==================================']" doc:name="Logger"/>
<logger level="INFO" message="#['======================= END : APP2 =================================']" doc:name="Logger"/>
</flow>
</mule>
Testing / Logger Information:
------------------------ Thank You -------------------------
(*) Steps : Execute below URLs.
PROJECT-1 :
Input :
http://localhost:9091/app1/set
Method : POST
Content-Type : application/json
Data : { “id” : “001” , “firstname” : “PRAKASH” }
Output :
Payload stored in ObjectStore...!!!
PROJECT-2 :
Input :
http://localhost:9091/app2/getall
Method : GET
Output:
[ { id=001, firstname=PRAKASH } ]
(*) Validate Log and Payload values

More Related Content

What's hot

Dropbox connector Mule ESB Integration
Dropbox connector Mule ESB IntegrationDropbox connector Mule ESB Integration
Dropbox connector Mule ESB IntegrationAnilKumar Etagowni
 
Integrate with database by groovy
Integrate with database by groovyIntegrate with database by groovy
Integrate with database by groovySon Nguyen
 
Mulesoft Using Groovy Component
Mulesoft Using Groovy ComponentMulesoft Using Groovy Component
Mulesoft Using Groovy Componentkumar gaurav
 
Mule esb
Mule esbMule esb
Mule esbKhan625
 
MuleSoft ESB - CSV File to Database
MuleSoft ESB - CSV File to DatabaseMuleSoft ESB - CSV File to Database
MuleSoft ESB - CSV File to Databaseakashdprajapati
 
Anypoint connectorfor ibm as 400
Anypoint connectorfor ibm as 400Anypoint connectorfor ibm as 400
Anypoint connectorfor ibm as 400himajareddys
 
Running ms sql stored procedures in mule
Running ms sql stored procedures in muleRunning ms sql stored procedures in mule
Running ms sql stored procedures in muleAnilKumar Etagowni
 
How to get http query parameters in mule
How to get http query parameters in muleHow to get http query parameters in mule
How to get http query parameters in muleRamakrishna kapa
 
For each component in mule
For each component in muleFor each component in mule
For each component in muleRajkattamuri
 
Mule esb data weave multi input data
Mule esb data weave multi input dataMule esb data weave multi input data
Mule esb data weave multi input dataAnilKumar Etagowni
 
Message properties component in Mule
Message properties component in MuleMessage properties component in Mule
Message properties component in MuleKhan625
 
Caching & validating
Caching & validatingCaching & validating
Caching & validatingSon Nguyen
 

What's hot (17)

Dropbox connector Mule ESB Integration
Dropbox connector Mule ESB IntegrationDropbox connector Mule ESB Integration
Dropbox connector Mule ESB Integration
 
Integrate with database by groovy
Integrate with database by groovyIntegrate with database by groovy
Integrate with database by groovy
 
Mulesoft Using Groovy Component
Mulesoft Using Groovy ComponentMulesoft Using Groovy Component
Mulesoft Using Groovy Component
 
Mule jdbc
Mule   jdbcMule   jdbc
Mule jdbc
 
Mule esb
Mule esbMule esb
Mule esb
 
Spring introduction
Spring introductionSpring introduction
Spring introduction
 
MuleSoft ESB - CSV File to Database
MuleSoft ESB - CSV File to DatabaseMuleSoft ESB - CSV File to Database
MuleSoft ESB - CSV File to Database
 
Anypoint connectorfor ibm as 400
Anypoint connectorfor ibm as 400Anypoint connectorfor ibm as 400
Anypoint connectorfor ibm as 400
 
Mule with stored procedure
Mule with stored procedureMule with stored procedure
Mule with stored procedure
 
Running ms sql stored procedures in mule
Running ms sql stored procedures in muleRunning ms sql stored procedures in mule
Running ms sql stored procedures in mule
 
Configurare http mule
Configurare http muleConfigurare http mule
Configurare http mule
 
Mule esb :Data Weave
Mule esb :Data WeaveMule esb :Data Weave
Mule esb :Data Weave
 
How to get http query parameters in mule
How to get http query parameters in muleHow to get http query parameters in mule
How to get http query parameters in mule
 
For each component in mule
For each component in muleFor each component in mule
For each component in mule
 
Mule esb data weave multi input data
Mule esb data weave multi input dataMule esb data weave multi input data
Mule esb data weave multi input data
 
Message properties component in Mule
Message properties component in MuleMessage properties component in Mule
Message properties component in Mule
 
Caching & validating
Caching & validatingCaching & validating
Caching & validating
 

Similar to MuleSoft ESB Object Store

How to execute an oracle stored procedure with nested table as a parameter fr...
How to execute an oracle stored procedure with nested table as a parameter fr...How to execute an oracle stored procedure with nested table as a parameter fr...
How to execute an oracle stored procedure with nested table as a parameter fr...Priyobroto Ghosh (Mule ESB Certified)
 
Mule esb
Mule esbMule esb
Mule esbjaveed_mhd
 
Mule esb
Mule esbMule esb
Mule esbHasan Syed
 
Mule esb:DataWeave
Mule esb:DataWeaveMule esb:DataWeave
Mule esb:DataWeaveAbdulImrankhan7
 
Mule esb
Mule esb Mule esb
Mule esb mdfkhan625
 
Mule esb dataweave
Mule esb dataweaveMule esb dataweave
Mule esb dataweaveRajkattamuri
 
Mule esb Data Weave
Mule esb Data WeaveMule esb Data Weave
Mule esb Data WeaveF K
 
The Magic Revealed: Four Real-World Examples of Using the Client Object Model...
The Magic Revealed: Four Real-World Examples of Using the Client Object Model...The Magic Revealed: Four Real-World Examples of Using the Client Object Model...
The Magic Revealed: Four Real-World Examples of Using the Client Object Model...SPTechCon
 
Full stack development with node and NoSQL - All Things Open - October 2017
Full stack development with node and NoSQL - All Things Open - October 2017Full stack development with node and NoSQL - All Things Open - October 2017
Full stack development with node and NoSQL - All Things Open - October 2017Matthew Groves
 
Full Stack Development with Node.js and NoSQL
Full Stack Development with Node.js and NoSQLFull Stack Development with Node.js and NoSQL
Full Stack Development with Node.js and NoSQLAll Things Open
 
Developing iOS REST Applications
Developing iOS REST ApplicationsDeveloping iOS REST Applications
Developing iOS REST Applicationslmrei
 
Spring dependency injection
Spring dependency injectionSpring dependency injection
Spring dependency injectionsrmelody
 
CocoaHeads PDX 2014 01 23 : CoreData and iCloud Improvements iOS7 / OSX Maver...
CocoaHeads PDX 2014 01 23 : CoreData and iCloud Improvements iOS7 / OSX Maver...CocoaHeads PDX 2014 01 23 : CoreData and iCloud Improvements iOS7 / OSX Maver...
CocoaHeads PDX 2014 01 23 : CoreData and iCloud Improvements iOS7 / OSX Maver...smn-automate
 
Diving into php
Diving into phpDiving into php
Diving into phpDan Phiffer
 
Saving Time And Effort With QuickBase Api - Sergio Haro
Saving Time And Effort With QuickBase Api - Sergio HaroSaving Time And Effort With QuickBase Api - Sergio Haro
Saving Time And Effort With QuickBase Api - Sergio HaroQuickBase, Inc.
 

Similar to MuleSoft ESB Object Store (20)

How to execute an oracle stored procedure with nested table as a parameter fr...
How to execute an oracle stored procedure with nested table as a parameter fr...How to execute an oracle stored procedure with nested table as a parameter fr...
How to execute an oracle stored procedure with nested table as a parameter fr...
 
Mule esb
Mule esbMule esb
Mule esb
 
Mule esb DataWeave
Mule esb DataWeaveMule esb DataWeave
Mule esb DataWeave
 
Mule esb
Mule esbMule esb
Mule esb
 
Mule esb
Mule esbMule esb
Mule esb
 
Mule esb :Data Weave
Mule esb :Data WeaveMule esb :Data Weave
Mule esb :Data Weave
 
Mule esb:DataWeave
Mule esb:DataWeaveMule esb:DataWeave
Mule esb:DataWeave
 
Mule esb
Mule esb Mule esb
Mule esb
 
Mule esb dataweave
Mule esb dataweaveMule esb dataweave
Mule esb dataweave
 
Mule esb Data Weave
Mule esb Data WeaveMule esb Data Weave
Mule esb Data Weave
 
The Magic Revealed: Four Real-World Examples of Using the Client Object Model...
The Magic Revealed: Four Real-World Examples of Using the Client Object Model...The Magic Revealed: Four Real-World Examples of Using the Client Object Model...
The Magic Revealed: Four Real-World Examples of Using the Client Object Model...
 
How to use Cache scope
How to use Cache scopeHow to use Cache scope
How to use Cache scope
 
Play!ng with scala
Play!ng with scalaPlay!ng with scala
Play!ng with scala
 
Full stack development with node and NoSQL - All Things Open - October 2017
Full stack development with node and NoSQL - All Things Open - October 2017Full stack development with node and NoSQL - All Things Open - October 2017
Full stack development with node and NoSQL - All Things Open - October 2017
 
Full Stack Development with Node.js and NoSQL
Full Stack Development with Node.js and NoSQLFull Stack Development with Node.js and NoSQL
Full Stack Development with Node.js and NoSQL
 
Developing iOS REST Applications
Developing iOS REST ApplicationsDeveloping iOS REST Applications
Developing iOS REST Applications
 
Spring dependency injection
Spring dependency injectionSpring dependency injection
Spring dependency injection
 
CocoaHeads PDX 2014 01 23 : CoreData and iCloud Improvements iOS7 / OSX Maver...
CocoaHeads PDX 2014 01 23 : CoreData and iCloud Improvements iOS7 / OSX Maver...CocoaHeads PDX 2014 01 23 : CoreData and iCloud Improvements iOS7 / OSX Maver...
CocoaHeads PDX 2014 01 23 : CoreData and iCloud Improvements iOS7 / OSX Maver...
 
Diving into php
Diving into phpDiving into php
Diving into php
 
Saving Time And Effort With QuickBase Api - Sergio Haro
Saving Time And Effort With QuickBase Api - Sergio HaroSaving Time And Effort With QuickBase Api - Sergio Haro
Saving Time And Effort With QuickBase Api - Sergio Haro
 

More from akashdprajapati

MuleSoft ESB CSV to XML
MuleSoft ESB CSV to XMLMuleSoft ESB CSV to XML
MuleSoft ESB CSV to XMLakashdprajapati
 
MuleSoft ESB Payload Encrypt Decrypt using anypoint enterprise security
MuleSoft ESB Payload Encrypt Decrypt using anypoint enterprise securityMuleSoft ESB Payload Encrypt Decrypt using anypoint enterprise security
MuleSoft ESB Payload Encrypt Decrypt using anypoint enterprise securityakashdprajapati
 
MuleSoft ESB Sending email using hmailserver
MuleSoft ESB Sending email using hmailserverMuleSoft ESB Sending email using hmailserver
MuleSoft ESB Sending email using hmailserverakashdprajapati
 
Mule Soft ESB - SAP Outbound
Mule Soft ESB - SAP OutboundMule Soft ESB - SAP Outbound
Mule Soft ESB - SAP Outboundakashdprajapati
 
MuleSoft ESB Testing Mule Application using MUnit Test Suite
MuleSoft ESB Testing Mule Application using MUnit Test SuiteMuleSoft ESB Testing Mule Application using MUnit Test Suite
MuleSoft ESB Testing Mule Application using MUnit Test Suiteakashdprajapati
 
MuleSoft ESB Composite Source
MuleSoft ESB Composite SourceMuleSoft ESB Composite Source
MuleSoft ESB Composite Sourceakashdprajapati
 

More from akashdprajapati (6)

MuleSoft ESB CSV to XML
MuleSoft ESB CSV to XMLMuleSoft ESB CSV to XML
MuleSoft ESB CSV to XML
 
MuleSoft ESB Payload Encrypt Decrypt using anypoint enterprise security
MuleSoft ESB Payload Encrypt Decrypt using anypoint enterprise securityMuleSoft ESB Payload Encrypt Decrypt using anypoint enterprise security
MuleSoft ESB Payload Encrypt Decrypt using anypoint enterprise security
 
MuleSoft ESB Sending email using hmailserver
MuleSoft ESB Sending email using hmailserverMuleSoft ESB Sending email using hmailserver
MuleSoft ESB Sending email using hmailserver
 
Mule Soft ESB - SAP Outbound
Mule Soft ESB - SAP OutboundMule Soft ESB - SAP Outbound
Mule Soft ESB - SAP Outbound
 
MuleSoft ESB Testing Mule Application using MUnit Test Suite
MuleSoft ESB Testing Mule Application using MUnit Test SuiteMuleSoft ESB Testing Mule Application using MUnit Test Suite
MuleSoft ESB Testing Mule Application using MUnit Test Suite
 
MuleSoft ESB Composite Source
MuleSoft ESB Composite SourceMuleSoft ESB Composite Source
MuleSoft ESB Composite Source
 

Recently uploaded

HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfVishalKumarJha10
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfWilly Marroquin (WillyDevNET)
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionOnePlan Solutions
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdfAzure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdfryanfarris8
 
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...kalichargn70th171
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnAmarnathKambale
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
Exploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfExploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfproinshot.com
 

Recently uploaded (20)

HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdfAzure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
 
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
Exploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfExploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdf
 

MuleSoft ESB Object Store

  • 1. MuleSoft ESB Sharing Data Across Mule Applications By AKASH PRAJAPATI
  • 2. Scripting Support Topics : •Sharing Data Across Mule Applications Purpose : - To showcase object store functionality in MuleSoft ESB. - Using object store, Two different Mule Application shared data. Pre-requisites : •Basic under standing of Mule ESB •JDK 1.8 or above •Anypoint Studio v 6.2.1 or above •Mule Server v 3.8.0 EE or above
  • 3. Details : (*) Domain Project : Common resources are placed into this project (*) Mule Project – 1 : This Application can store data in the Common Shared Memory – ( Called Object Store ) (*) Mule Project – 2 : This Application will retrieve all data which are stored in common shared memory – ( Called Object Store )
  • 4. Flow Details : MULE_DOMAIN_PROJECT <?xml version="1.0" encoding="UTF-8"?> <domain:mule-domain xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:domain="http://www.mulesoft.org/schema/mule/ee/domain" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:spring="http://www.springframework.org/schema/beans" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation" xmlns:http="http://www.mulesoft.org/schema/mule/http" xsi:schemaLocation=" http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd http://www.mulesoft.org/schema/mule/ee/domain http://www.mulesoft.org/schema/mule/ee/domain/current/mule-domain-ee.xsd http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd"> <!-- configure here resource to be shared within the domain --> <http:listener-config name="HTTP_Listener_Configuration" host="0.0.0.0" port="9091" doc:name="HTTP Listener Configuration" /> <spring:beans> <spring:bean id="mySimpleMemoryObjectStore" class="org.mule.util.store.SimpleMemoryObjectStore" /> </spring:beans> </domain:mule-domain>
  • 5. <?xml version="1.0" encoding="UTF-8"?> <mule xmlns:objectstore="http://www.mulesoft.org/schema/mule/objectstore" xmlns:json="http://www.mulesoft.org/schema/mule/json" xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation" xmlns:spring="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.mulesoft.org/schema/mule/json http://www.mulesoft.org/schema/mule/json/current/mule-json.xsd http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd http://www.mulesoft.org/schema/mule/objectstore http://www.mulesoft.org/schema/mule/objectstore/current/mule-objectstore.xsd"> <objectstore:config name="ObjectStore" objectStore-ref="mySimpleMemoryObjectStore" doc:name="ObjectStore" /> <flow name="mule_app1_projectFlow"> <http:listener config-ref="HTTP_Listener_Configuration" path="/app1/set" doc:name="HTTP" /> <logger level="INFO" message="#['======================= START : APP1 =================================']" doc:name="Logger"/> <json:json-to-object-transformer returnClass="java.util.HashMap" doc:name="JSON to Object" /> <set-variable variableName="objStrSize" value="#[app.registry.mySimpleMemoryObjectStore.allKeys().size()]" doc:name="Set Count" /> <objectstore:store config-ref="ObjectStore" key="#[new java.lang.Integer(flowVars['objStrSize']+1)]" value-ref="#[payload]" doc:name="Add To ObjectStore"/> <set-payload value="Payload stored in ObjectStore...!!!" doc:name="Set Payload" /> <!-- <object-to-byte-array-transformer doc:name="Object to Byte Array" /> --> <logger level="INFO" message="#[payload]" doc:name="Logger"/> <logger level="INFO" message="#['======================= END : APP1 =================================']" doc:name="Logger"/> </flow> </mule> Flow Details : MULE_APP1_PROJECT
  • 6. Flow Details : MULE_APP2_PROJECT <?xml version="1.0" encoding="UTF-8"?> <mule xmlns:objectstore="http://www.mulesoft.org/schema/mule/objectstore" xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation" xmlns:spring="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd http://www.mulesoft.org/schema/mule/objectstore http://www.mulesoft.org/schema/mule/objectstore/current/mule-objectstore.xsd"> <objectstore:config name="ObjectStore" objectStore-ref="mySimpleMemoryObjectStore" doc:name="ObjectStore" /> <flow name="mule_app2_projectFlow"> <http:listener config-ref="HTTP_Listener_Configuration" path="/app2/getall" doc:name="HTTP"/> <logger level="INFO" message="#['======================= START : APP2 =================================']" doc:name="Logger"/> <set-variable variableName="varAllData" value="#[new java.util.ArrayList()]" doc:name="Variable - Message Arraylist"/> <foreach collection="#[app.registry.mySimpleMemoryObjectStore.allKeys()]" doc:name="For Each" counterVariableName="i"> <objectstore:retrieve config-ref="ObjectStore" key="#[new java.lang.Integer(i)]" doc:name="Retrieve Message"/> <object-to-string-transformer doc:name="Object to String" /> <logger message="Values #[new java.lang.Integer(i)] : #[message.payload]" level="INFO" doc:name="Logger" /> <expression-component doc:name="Add Message to ArrayList"> <![CDATA[flowVars['varAllData'].add(payload)]]> </expression-component> </foreach> <set-payload doc:name="Set Payload" value="#[flowVars['varAllData']] "/> <logger level="INFO" message="#['==================================']" doc:name="Logger"/> <logger level="INFO" message="#[payload]" doc:name="Logger"/> <logger level="INFO" message="#['==================================']" doc:name="Logger"/> <logger level="INFO" message="#['======================= END : APP2 =================================']" doc:name="Logger"/> </flow> </mule>
  • 7. Testing / Logger Information: ------------------------ Thank You ------------------------- (*) Steps : Execute below URLs. PROJECT-1 : Input : http://localhost:9091/app1/set Method : POST Content-Type : application/json Data : { “id” : “001” , “firstname” : “PRAKASH” } Output : Payload stored in ObjectStore...!!! PROJECT-2 : Input : http://localhost:9091/app2/getall Method : GET Output: [ { id=001, firstname=PRAKASH } ] (*) Validate Log and Payload values