SlideShare a Scribd company logo
1 of 11
Creating Dynamic JSON in Mule
Mule ESB has multiple options to create dynamic payload. The payload used in Mule can be of
multiple types like JSON, XML or simple Text payload.
With Mule we can dynamically generate any type of payload at any point of time in the flow.
We will see how to create a simple JSON payload dynamically within a Mule flow and post that JSON
to an external service and get a response.
Itā€™s quite simple and we will see how we can generate a JSON in a flow.
Let us consider we need to create a JSON file as following :-
{
"myService": {
"messageHeader": {
"messageId": "ec75da88e64a739e12c126",
"messageDateTime": "2014-09-18T14:07:46+0530"
},
"mesageBody": {
"myServiceRequest": {
"Amount": 3520,
"ConsumerId": "ABC-T14005-AFF",
"Timestamp": "2014-10-27T18:36:18+0700"
}
}
}
}
Now, we need to create this flow in our Mule flow and send the JSON request created to the external service
and will get a response. We will assign the JSON elements value from flow variables for now, but you can use
message inbound properties or other ways to assign the flow variables dynamically within the flow.
We will use Mule Expression Transformer to create this JSON request. As per Mule documentation here
https://developer.mulesoft.com/docs/display/current/Expression+Transformer+Reference :-
The Expression Transformer executes one or more expressions on the current message. The results of these
expressions becomes the payload of the current message.
Letā€™s consider our Mule flow as following :-
Here you can see, the expression transformer is creating the JSON request which is send to the external web service. The
flow variables are used to set the value and you can assign the variables dynamically in your way.
Now letā€™s test our flow by placing by hitting the url http://localhost:8085/rc/test on browser as
follows, :-
The JSON request will be generated in the flow and with that request it will be posted to the external
web service which will return a response
Now, we can see in our logger the JSON request generated and the JSON response from the external
service in return :-
So, here you can see how to set a Dynamic JSON and can be send to the external service to get a
responseā€¦. you can try this with your requirement as well and set the value dynamically in the flow
variables or can use other dynamic options like inbound properties etc !!!ā€¦.ļŠ
In my next slide I will bring some other techniques in Mule implementation .
Hope you have enjoyed this simpler version.
Keep sharing your knowledge and let our Mule community grow ļŠ
Creating Dynamic JSON in Mule ESB

More Related Content

Viewers also liked

Converting with custom transforme
Converting with custom transformeConverting with custom transforme
Converting with custom transformeKhasim Saheb
Ā 
A simple webservice with vm
A simple webservice with vm A simple webservice with vm
A simple webservice with vm Khasim Saheb
Ā 
Automatic documantation with mule
Automatic documantation with mule Automatic documantation with mule
Automatic documantation with mule Khasim Saheb
Ā 
Pesquisanaescolasoniaantonia
PesquisanaescolasoniaantoniaPesquisanaescolasoniaantonia
PesquisanaescolasoniaantoniaSonia Fukuda
Ā 
Deploying and Running in Mule
Deploying and Running in MuleDeploying and Running in Mule
Deploying and Running in MuleKhasim Saheb
Ā 
Stored procedure in Mule
Stored procedure in MuleStored procedure in Mule
Stored procedure in MuleKhasim Saheb
Ā 
Mule security jaas
Mule security jaasMule security jaas
Mule security jaasKhasim Saheb
Ā 
How to use expression filter
How to use expression filterHow to use expression filter
How to use expression filterKhasim Saheb
Ā 
Anypoint data gateway
Anypoint data gatewayAnypoint data gateway
Anypoint data gatewayKhasim Saheb
Ā 
web services
web servicesweb services
web servicesKhasim Saheb
Ā 
Mule esb api layer
Mule esb api layerMule esb api layer
Mule esb api layerKhasim Saheb
Ā 
Mule architecture
Mule architectureMule architecture
Mule architectureKhasim Saheb
Ā 
Mule integration with linkedin
Mule integration with linkedinMule integration with linkedin
Mule integration with linkedinKhasim Saheb
Ā 
Webservices using Salesforce
Webservices using SalesforceWebservices using Salesforce
Webservices using SalesforceKhasim Saheb
Ā 
Shripal Doshi CV
Shripal Doshi CVShripal Doshi CV
Shripal Doshi CVshripaldoshi
Ā 

Viewers also liked (18)

Converting with custom transforme
Converting with custom transformeConverting with custom transforme
Converting with custom transforme
Ā 
A simple webservice with vm
A simple webservice with vm A simple webservice with vm
A simple webservice with vm
Ā 
Data weave
Data weave Data weave
Data weave
Ā 
Mule Esb
Mule EsbMule Esb
Mule Esb
Ā 
Automatic documantation with mule
Automatic documantation with mule Automatic documantation with mule
Automatic documantation with mule
Ā 
Pesquisanaescolasoniaantonia
PesquisanaescolasoniaantoniaPesquisanaescolasoniaantonia
Pesquisanaescolasoniaantonia
Ā 
Deploying and Running in Mule
Deploying and Running in MuleDeploying and Running in Mule
Deploying and Running in Mule
Ā 
Stored procedure in Mule
Stored procedure in MuleStored procedure in Mule
Stored procedure in Mule
Ā 
Mule security jaas
Mule security jaasMule security jaas
Mule security jaas
Ā 
How to use expression filter
How to use expression filterHow to use expression filter
How to use expression filter
Ā 
Anypoint data gateway
Anypoint data gatewayAnypoint data gateway
Anypoint data gateway
Ā 
web services
web servicesweb services
web services
Ā 
Mule esb api layer
Mule esb api layerMule esb api layer
Mule esb api layer
Ā 
Mule architecture
Mule architectureMule architecture
Mule architecture
Ā 
Mule integration with linkedin
Mule integration with linkedinMule integration with linkedin
Mule integration with linkedin
Ā 
Webservices using Salesforce
Webservices using SalesforceWebservices using Salesforce
Webservices using Salesforce
Ā 
Mule soa
Mule soaMule soa
Mule soa
Ā 
Shripal Doshi CV
Shripal Doshi CVShripal Doshi CV
Shripal Doshi CV
Ā 

Similar to Creating Dynamic JSON in Mule ESB

Create dynamic json using mule
Create dynamic json using muleCreate dynamic json using mule
Create dynamic json using muleSon Nguyen
Ā 
Validating soap request in mule
Validating soap request in mule Validating soap request in mule
Validating soap request in mule javeed_mhd
Ā 
Validate soap request in mule
Validate soap request in muleValidate soap request in mule
Validate soap request in muleSunil Komarapu
Ā 
Validate soap request in mule
Validate soap request in muleValidate soap request in mule
Validate soap request in muleHasan Syed
Ā 
Validate soap request in mule
Validate soap request in muleValidate soap request in mule
Validate soap request in muleMohammed246
Ā 
Validating a soap request in mule
Validating a soap request in muleValidating a soap request in mule
Validating a soap request in muleKhan625
Ā 
Validating a soap request in mule
Validating a soap request in mule Validating a soap request in mule
Validating a soap request in mule AbdulImrankhan7
Ā 
Validating soap request in mule
Validating soap request in mule Validating soap request in mule
Validating soap request in mule mdfkhan625
Ā 
Validating a soap request in mule
Validating a soap request in muleValidating a soap request in mule
Validating a soap request in muleRajkattamuri
Ā 
Validate Soap Request in Mule
Validate Soap Request in MuleValidate Soap Request in Mule
Validate Soap Request in Muleirfan1008
Ā 
Json to json transformation in mule
Json to json transformation in muleJson to json transformation in mule
Json to json transformation in muleDavide Rapacciuolo
Ā 
Webapplicationwithmule by raju
Webapplicationwithmule by rajuWebapplicationwithmule by raju
Webapplicationwithmule by rajuRaju N
Ā 
Transformation jsontojsonesb
Transformation jsontojsonesbTransformation jsontojsonesb
Transformation jsontojsonesbAntonio Pellegrino
Ā 
Transformation jsontojsonesb
Transformation jsontojsonesbTransformation jsontojsonesb
Transformation jsontojsonesbGermano Barba
Ā 
Playing with cxf interceptor in mule
Playing with cxf interceptor in mulePlaying with cxf interceptor in mule
Playing with cxf interceptor in muleAnirban Sen Chowdhary
Ā 
Webapplicationwithmule by nagarjuanreddy
Webapplicationwithmule by nagarjuanreddyWebapplicationwithmule by nagarjuanreddy
Webapplicationwithmule by nagarjuanreddyNagarjuna reddy
Ā 

Similar to Creating Dynamic JSON in Mule ESB (20)

Create dynamic json using mule
Create dynamic json using muleCreate dynamic json using mule
Create dynamic json using mule
Ā 
Creating dynamic json
Creating dynamic jsonCreating dynamic json
Creating dynamic json
Ā 
Splitting with mule part2
Splitting with mule part2Splitting with mule part2
Splitting with mule part2
Ā 
Validating soap request in mule
Validating soap request in mule Validating soap request in mule
Validating soap request in mule
Ā 
Validate soap request in mule
Validate soap request in muleValidate soap request in mule
Validate soap request in mule
Ā 
Validate soap request in mule
Validate soap request in muleValidate soap request in mule
Validate soap request in mule
Ā 
Validate soap request in mule
Validate soap request in muleValidate soap request in mule
Validate soap request in mule
Ā 
Validating a soap request in mule
Validating a soap request in muleValidating a soap request in mule
Validating a soap request in mule
Ā 
Validating a soap request in mule
Validating a soap request in mule Validating a soap request in mule
Validating a soap request in mule
Ā 
Validating soap request in mule
Validating soap request in mule Validating soap request in mule
Validating soap request in mule
Ā 
Validating a soap request in mule
Validating a soap request in muleValidating a soap request in mule
Validating a soap request in mule
Ā 
Validate Soap Request in Mule
Validate Soap Request in MuleValidate Soap Request in Mule
Validate Soap Request in Mule
Ā 
Web application with mule
Web application with muleWeb application with mule
Web application with mule
Ā 
Json to json transformation in mule
Json to json transformation in muleJson to json transformation in mule
Json to json transformation in mule
Ā 
Webapplicationwithmule by raju
Webapplicationwithmule by rajuWebapplicationwithmule by raju
Webapplicationwithmule by raju
Ā 
Transformation jsontojsonesb
Transformation jsontojsonesbTransformation jsontojsonesb
Transformation jsontojsonesb
Ā 
Transformation jsontojsonesb
Transformation jsontojsonesbTransformation jsontojsonesb
Transformation jsontojsonesb
Ā 
Playing with cxf interceptor in mule
Playing with cxf interceptor in mulePlaying with cxf interceptor in mule
Playing with cxf interceptor in mule
Ā 
Using ajax in mule
Using ajax in muleUsing ajax in mule
Using ajax in mule
Ā 
Webapplicationwithmule by nagarjuanreddy
Webapplicationwithmule by nagarjuanreddyWebapplicationwithmule by nagarjuanreddy
Webapplicationwithmule by nagarjuanreddy
Ā 

More from Khasim Saheb

Mule anypoint exchange
Mule anypoint exchangeMule anypoint exchange
Mule anypoint exchangeKhasim Saheb
Ā 
Mule security saml
Mule security samlMule security saml
Mule security samlKhasim Saheb
Ā 
Mule for each scope headerc ollection
Mule for each scope headerc ollectionMule for each scope headerc ollection
Mule for each scope headerc ollectionKhasim Saheb
Ā 
Mule esb stripe
Mule esb stripeMule esb stripe
Mule esb stripeKhasim Saheb
Ā 
Mmc rest api user groups
Mmc rest api user groupsMmc rest api user groups
Mmc rest api user groupsKhasim Saheb
Ā 
Mapping and listing with mule
Mapping and listing with muleMapping and listing with mule
Mapping and listing with muleKhasim Saheb
Ā 
How to use message properties component
How to use message properties componentHow to use message properties component
How to use message properties componentKhasim Saheb
Ā 
Caching and invalidating with managed store
Caching and invalidating with managed storeCaching and invalidating with managed store
Caching and invalidating with managed storeKhasim Saheb
Ā 
Cache for community edition
Cache for community edition Cache for community edition
Cache for community edition Khasim Saheb
Ā 
mule salesforce
mule salesforcemule salesforce
mule salesforceKhasim Saheb
Ā 
mulesoft filters
mulesoft filtersmulesoft filters
mulesoft filtersKhasim Saheb
Ā 
mulesoft at a glance
mulesoft at a glancemulesoft at a glance
mulesoft at a glanceKhasim Saheb
Ā 

More from Khasim Saheb (16)

Mule anypoint exchange
Mule anypoint exchangeMule anypoint exchange
Mule anypoint exchange
Ā 
Mule soap
Mule soapMule soap
Mule soap
Ā 
Mule security saml
Mule security samlMule security saml
Mule security saml
Ā 
Mule for each scope headerc ollection
Mule for each scope headerc ollectionMule for each scope headerc ollection
Mule for each scope headerc ollection
Ā 
Mule esb
Mule esbMule esb
Mule esb
Ā 
Mule esb stripe
Mule esb stripeMule esb stripe
Mule esb stripe
Ā 
Mmc
MmcMmc
Mmc
Ā 
Mmc rest api user groups
Mmc rest api user groupsMmc rest api user groups
Mmc rest api user groups
Ā 
Mapping and listing with mule
Mapping and listing with muleMapping and listing with mule
Mapping and listing with mule
Ā 
How to use message properties component
How to use message properties componentHow to use message properties component
How to use message properties component
Ā 
Caching and invalidating with managed store
Caching and invalidating with managed storeCaching and invalidating with managed store
Caching and invalidating with managed store
Ā 
Cache for community edition
Cache for community edition Cache for community edition
Cache for community edition
Ā 
mule salesforce
mule salesforcemule salesforce
mule salesforce
Ā 
mulesoft filters
mulesoft filtersmulesoft filters
mulesoft filters
Ā 
mulesoft at a glance
mulesoft at a glancemulesoft at a glance
mulesoft at a glance
Ā 
Core Java
Core JavaCore Java
Core Java
Ā 

Recently uploaded

Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
Ā 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
Ā 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
Ā 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
Ā 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
Ā 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
Ā 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
Ā 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Neo4j
Ā 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
Ā 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
Ā 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraDeakin University
Ā 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
Ā 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
Ā 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
Ā 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
Ā 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
Ā 
Integration and Automation in Practice: CI/CD in MuleĀ Integration and Automat...
Integration and Automation in Practice: CI/CD in MuleĀ Integration and Automat...Integration and Automation in Practice: CI/CD in MuleĀ Integration and Automat...
Integration and Automation in Practice: CI/CD in MuleĀ Integration and Automat...Patryk Bandurski
Ā 

Recently uploaded (20)

E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
Ā 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
Ā 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
Ā 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
Ā 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
Ā 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
Ā 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
Ā 
Hot Sexy call girls in Panjabi Bagh šŸ” 9953056974 šŸ” Delhi escort Service
Hot Sexy call girls in Panjabi Bagh šŸ” 9953056974 šŸ” Delhi escort ServiceHot Sexy call girls in Panjabi Bagh šŸ” 9953056974 šŸ” Delhi escort Service
Hot Sexy call girls in Panjabi Bagh šŸ” 9953056974 šŸ” Delhi escort Service
Ā 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Ā 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024
Ā 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Ā 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
Ā 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning era
Ā 
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptxVulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Ā 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
Ā 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
Ā 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
Ā 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Ā 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
Ā 
Integration and Automation in Practice: CI/CD in MuleĀ Integration and Automat...
Integration and Automation in Practice: CI/CD in MuleĀ Integration and Automat...Integration and Automation in Practice: CI/CD in MuleĀ Integration and Automat...
Integration and Automation in Practice: CI/CD in MuleĀ Integration and Automat...
Ā 

Creating Dynamic JSON in Mule ESB

  • 2. Mule ESB has multiple options to create dynamic payload. The payload used in Mule can be of multiple types like JSON, XML or simple Text payload. With Mule we can dynamically generate any type of payload at any point of time in the flow. We will see how to create a simple JSON payload dynamically within a Mule flow and post that JSON to an external service and get a response. Itā€™s quite simple and we will see how we can generate a JSON in a flow.
  • 3.
  • 4. Let us consider we need to create a JSON file as following :- { "myService": { "messageHeader": { "messageId": "ec75da88e64a739e12c126", "messageDateTime": "2014-09-18T14:07:46+0530" }, "mesageBody": { "myServiceRequest": { "Amount": 3520, "ConsumerId": "ABC-T14005-AFF", "Timestamp": "2014-10-27T18:36:18+0700" } } } } Now, we need to create this flow in our Mule flow and send the JSON request created to the external service and will get a response. We will assign the JSON elements value from flow variables for now, but you can use message inbound properties or other ways to assign the flow variables dynamically within the flow.
  • 5. We will use Mule Expression Transformer to create this JSON request. As per Mule documentation here https://developer.mulesoft.com/docs/display/current/Expression+Transformer+Reference :- The Expression Transformer executes one or more expressions on the current message. The results of these expressions becomes the payload of the current message.
  • 6. Letā€™s consider our Mule flow as following :- Here you can see, the expression transformer is creating the JSON request which is send to the external web service. The flow variables are used to set the value and you can assign the variables dynamically in your way.
  • 7. Now letā€™s test our flow by placing by hitting the url http://localhost:8085/rc/test on browser as follows, :- The JSON request will be generated in the flow and with that request it will be posted to the external web service which will return a response
  • 8. Now, we can see in our logger the JSON request generated and the JSON response from the external service in return :-
  • 9. So, here you can see how to set a Dynamic JSON and can be send to the external service to get a responseā€¦. you can try this with your requirement as well and set the value dynamically in the flow variables or can use other dynamic options like inbound properties etc !!!ā€¦.ļŠ
  • 10. In my next slide I will bring some other techniques in Mule implementation . Hope you have enjoyed this simpler version. Keep sharing your knowledge and let our Mule community grow ļŠ