SlideShare a Scribd company logo
1 of 7
Mule For Each Scope – Header Collection
• In this slide deck we will see how Foreach processes a
collection in message header
Message Header Collection
Let us write a Mule flow which listens on HTTP Listener and let
us test the flow with below url having a list of query params
http://localhost:8081/foreach-headertest?names=Ram,Amar,Nag
The value of the query parmater “names” is a list of comma
separated values.
We want to process this list using Foreach scope
• Mule HTTP Listener converts query parameters into a
Map. We can access these query parameters using the key
‘http.query.params’
• In our case the query parameter is a comma seperated
values
• We need to convert the comma seperated values to a
List, then we can apply Foreach scope. For this purpose we
nee to write a Java component
The Java component which converts comma seperated
values to a List
We use this Java component in our flow to convert
query parameters to a List
Flow:
We used Java component ‘QueryParamsToList’ immediately
after HTTP Listener to convert query parmas to a List.
Output:
Mule for each scope headerc ollection

More Related Content

What's hot (12)

Mule scopes foreach_scope
Mule scopes foreach_scopeMule scopes foreach_scope
Mule scopes foreach_scope
 
Server Load Balancing
Server Load BalancingServer Load Balancing
Server Load Balancing
 
Example of BDD/scenario based vertical slicing (for PM/PO community)
Example of BDD/scenario based vertical slicing (for PM/PO community)Example of BDD/scenario based vertical slicing (for PM/PO community)
Example of BDD/scenario based vertical slicing (for PM/PO community)
 
Mule MongoDB connector
Mule MongoDB connectorMule MongoDB connector
Mule MongoDB connector
 
Http mule
Http muleHttp mule
Http mule
 
Apache Ambari Meetup at Dataworks Summit 2017
Apache Ambari Meetup at Dataworks Summit 2017Apache Ambari Meetup at Dataworks Summit 2017
Apache Ambari Meetup at Dataworks Summit 2017
 
Spring integration
Spring integrationSpring integration
Spring integration
 
Ajax
AjaxAjax
Ajax
 
Mule message state
Mule message stateMule message state
Mule message state
 
Spring integration
Spring integrationSpring integration
Spring integration
 
Bindings of components in mule
Bindings of components in muleBindings of components in mule
Bindings of components in mule
 
How to create sitemap for website
How to create sitemap for websiteHow to create sitemap for website
How to create sitemap for website
 

Viewers also liked

Viewers also liked (20)

.Net architecture with mule soft
.Net architecture with mule soft.Net architecture with mule soft
.Net architecture with mule soft
 
Mule management console installation
Mule management console installation Mule management console installation
Mule management console installation
 
Mule database-connectors
Mule database-connectorsMule database-connectors
Mule database-connectors
 
Mapping and listing with mule
Mapping and listing with muleMapping and listing with mule
Mapping and listing with mule
 
Mule soap
Mule soapMule soap
Mule soap
 
Mule esb
Mule esbMule esb
Mule esb
 
Mule batch processing
Mule batch processingMule batch processing
Mule batch processing
 
Mule google connectors
Mule google connectorsMule google connectors
Mule google connectors
 
Github plugin setup in anypointstudio
Github plugin setup in anypointstudioGithub plugin setup in anypointstudio
Github plugin setup in anypointstudio
 
Filter expression in mule
Filter expression in muleFilter expression in mule
Filter expression in mule
 
File component in mule
File component in muleFile component in mule
File component in mule
 
Dataweave 160103180124
Dataweave 160103180124Dataweave 160103180124
Dataweave 160103180124
 
Mule integration with linkedin
Mule integration with linkedinMule integration with linkedin
Mule integration with linkedin
 
Mule soa
Mule soaMule soa
Mule soa
 
Mule esb made system integration easy
Mule esb made system integration easy Mule esb made system integration easy
Mule esb made system integration easy
 
Mule jdbc
Mule   jdbcMule   jdbc
Mule jdbc
 
Until successful component in mule
Until successful component in muleUntil successful component in mule
Until successful component in mule
 
Message properties component in Mule
Message properties component in MuleMessage properties component in Mule
Message properties component in Mule
 
Junit in mule
Junit in muleJunit in mule
Junit in mule
 
Mule esb soap_service
Mule esb soap_serviceMule esb soap_service
Mule esb soap_service
 

Similar to Mule for each scope headerc ollection

Rails Request & Middlewares
Rails Request & MiddlewaresRails Request & Middlewares
Rails Request & Middlewares
Santosh Wadghule
 

Similar to Mule for each scope headerc ollection (20)

EST is a software architectural style that was created to guide the design an...
EST is a software architectural style that was created to guide the design an...EST is a software architectural style that was created to guide the design an...
EST is a software architectural style that was created to guide the design an...
 
Sun certifiedwebcomponentdeveloperstudyguide
Sun certifiedwebcomponentdeveloperstudyguideSun certifiedwebcomponentdeveloperstudyguide
Sun certifiedwebcomponentdeveloperstudyguide
 
General configurations on apache directives included in the httpd.conf file
General configurations on apache directives included in the httpd.conf fileGeneral configurations on apache directives included in the httpd.conf file
General configurations on apache directives included in the httpd.conf file
 
Raml part 1
Raml part 1Raml part 1
Raml part 1
 
Data weave (MuleSoft)
Data weave (MuleSoft)Data weave (MuleSoft)
Data weave (MuleSoft)
 
Rails Request & Middlewares
Rails Request & MiddlewaresRails Request & Middlewares
Rails Request & Middlewares
 
Servlet.ppt
Servlet.pptServlet.ppt
Servlet.ppt
 
Servlet.ppt
Servlet.pptServlet.ppt
Servlet.ppt
 
Servlet1.ppt
Servlet1.pptServlet1.ppt
Servlet1.ppt
 
Mule concepts transformers
Mule concepts transformersMule concepts transformers
Mule concepts transformers
 
Parameters as a part of body
Parameters as a part of bodyParameters as a part of body
Parameters as a part of body
 
Design API using RAML - basics
Design API using RAML - basicsDesign API using RAML - basics
Design API using RAML - basics
 
Mule message enricher
Mule message enricherMule message enricher
Mule message enricher
 
Php
PhpPhp
Php
 
Working with data.pptx
Working with data.pptxWorking with data.pptx
Working with data.pptx
 
Developing web apps using Erlang-Web
Developing web apps using Erlang-WebDeveloping web apps using Erlang-Web
Developing web apps using Erlang-Web
 
RAML - The architecture
RAML  - The architectureRAML  - The architecture
RAML - The architecture
 
Spray
SpraySpray
Spray
 
Lunacloud's Compute RESTful API - Programmer's Guide
Lunacloud's Compute RESTful API - Programmer's GuideLunacloud's Compute RESTful API - Programmer's Guide
Lunacloud's Compute RESTful API - Programmer's Guide
 
Informatica overview
Informatica overviewInformatica overview
Informatica overview
 

More from Khasim Saheb

More from Khasim Saheb (20)

Mule architecture
Mule architectureMule architecture
Mule architecture
 
Mule anypoint exchange
Mule anypoint exchangeMule anypoint exchange
Mule anypoint exchange
 
Mule soap
Mule soapMule soap
Mule soap
 
Mule soa
Mule soaMule soa
Mule soa
 
Mule security saml
Mule security samlMule security saml
Mule security saml
 
Mule security jaas
Mule security jaasMule security jaas
Mule security jaas
 
Mule esb stripe
Mule esb stripeMule esb stripe
Mule esb stripe
 
Mule esb api layer
Mule esb api layerMule esb api layer
Mule esb api layer
 
Mmc
MmcMmc
Mmc
 
Mmc rest api user groups
Mmc rest api user groupsMmc rest api user groups
Mmc rest api user groups
 
How to use message properties component
How to use message properties componentHow to use message properties component
How to use message properties component
 
How to use expression filter
How to use expression filterHow to use expression filter
How to use expression filter
 
Data weave
Data weave Data weave
Data weave
 
Anypoint data gateway
Anypoint data gatewayAnypoint data gateway
Anypoint data gateway
 
Creating dynamic json
Creating dynamic json Creating dynamic json
Creating dynamic json
 
Converting with custom transforme
Converting with custom transformeConverting with custom transforme
Converting with custom transforme
 
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
 
Automatic documantation with mule
Automatic documantation with mule Automatic documantation with mule
Automatic documantation with mule
 
A simple webservice with vm
A simple webservice with vm A simple webservice with vm
A simple webservice with vm
 

Recently uploaded

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Recently uploaded (20)

Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 

Mule for each scope headerc ollection

  • 1. Mule For Each Scope – Header Collection
  • 2. • In this slide deck we will see how Foreach processes a collection in message header
  • 3. Message Header Collection Let us write a Mule flow which listens on HTTP Listener and let us test the flow with below url having a list of query params http://localhost:8081/foreach-headertest?names=Ram,Amar,Nag The value of the query parmater “names” is a list of comma separated values. We want to process this list using Foreach scope
  • 4. • Mule HTTP Listener converts query parameters into a Map. We can access these query parameters using the key ‘http.query.params’ • In our case the query parameter is a comma seperated values • We need to convert the comma seperated values to a List, then we can apply Foreach scope. For this purpose we nee to write a Java component
  • 5. The Java component which converts comma seperated values to a List We use this Java component in our flow to convert query parameters to a List
  • 6. Flow: We used Java component ‘QueryParamsToList’ immediately after HTTP Listener to convert query parmas to a List. Output: