SlideShare a Scribd company logo
Ankit Lawaniya
9/3/2017 Ankit Lawaniya 1
Mule Message Enricher is one of the scopes in Mule which allows the
current message to be augmented using data from a separate
resource, which we call the Enrichment Resource. The Mule
implementation of the Enrichment Resource (a source of data to
augment the current message) can be any message processor.
In simple language, we can say a message enricher
enriches the current payload with some additional message or
information and this is done without disturbing the current payload.
Enricher is used if the target system needs more information than the
source system can provide. It enriches the Mule message by calling an
external system or doing some transformation to the existing payload
and saving it into some scope of variable, like session, outbound, or
invocation, and the transformation happening in the enricher scope
doesn't affect the actual payload. Set-property: Save some information
extracted from payload or original payload to some invocation or
flow scope variable.
9/3/2017 Ankit Lawaniya 2
9/3/2017 Ankit Lawaniya 3
 The Mule Message Enricher is designed for performing interactions like
calling an outbound endpoint and bringing the result back to the main
flow, which will be used to add the additional information into the
existing payload.
 One common scenario involves the need to enrich an incoming message
with information that isn’t provided by the source system. You can use a
content enricher if the target system needs more information than the
source system can provide.
 Mule Message Enricher allows the current message to be used in
performing a particular task separately without disturbing the original
message. Mule Message Enricher is best used in the case when you do not
want to lose your existing payload.
Example: If, in your flow, if you need to call an external service with an HTTP
outbound/HTTP request component in middle of the flow after getting the
response from the HTTP external service call you will find that your current
payload is modified with the response of the external service, but you didn't
want to change or disturb the existing payload. In that case, we can wrap our
HTTP outbound/HTTP request component inside the enricher and it will
make a call to the external system, store the result and your existing payload
will not be modified.
9/3/2017 Ankit Lawaniya 4
Below is the step by step process to demonstrate
how Message Enricher works.
 Enricher sends a copy of the original message
into the processor.
 The original message waits.
 The copy is processed.
 The copy's response is a message.
 Part(s) of the response are added to part(s) of
the original message.
 The enriched message moves forward.
9/3/2017 Ankit Lawaniya 5
 The way in which the message is enriched (or modified) is by
explicitly configuring mappings (source->target) between the result
from the Enrichment Resource and the message using Mule
Expressions. Mule Expressions are used to both select the value to be
extracted from the result that comes back from the Enrichment
Resource (source) and to define where this value to be inserted into
the message (target). The default source, if not configured, is the
payload of the result from the Enrichment Resource.
The “enrichment resource” can be any message processor, outbound
connector, processor-chain, or flow-ref. If using an outbound-connector
then, of course, it should have a request-response exchange pattern.
9/3/2017 Ankit Lawaniya 6
 IMP Note: As only one component can reside inside Message Enricher,
use of processor chain is recommended if more components are needed to
reside inside Message Enricher.
Let’s walk through how to use Mule Message Enricher in application. In this
example, we are receiving the JSON Request consisting Employee data with
id and role of the employee through HTTP call from the REST client. Our
objective here is to add the additional information which is the name of the
employee to the source data. For this, we will be calling Database to get the
information about the employee name and that will be added in the
source JSON to be sent back to the user.
9/3/2017 Ankit Lawaniya 7
9/3/2017 Ankit Lawaniya 8
9/3/2017 Ankit Lawaniya 9
 Request:
{
"id": 1,
"role": "Application Developer"
}
 Response:
{
"id": 1,
"name": "Ankit",
"Role": "Application Developer"
}
9/3/2017 Ankit Lawaniya 10
9/3/2017 Ankit Lawaniya 11
9/3/2017 Ankit Lawaniya 12
Ad

More Related Content

Similar to Content enrichment using mule message enricher (20)

Mule ESB Interview or Certification questions
Mule ESB Interview or Certification questionsMule ESB Interview or Certification questions
Mule ESB Interview or Certification questions
TechieVarsity
 
Composite source in mule
Composite source in muleComposite source in mule
Composite source in mule
Ankit Lawaniya
 
Mule fundamentals
Mule fundamentalsMule fundamentals
Mule fundamentals
prudhvivreddy
 
Synchronous and asynchronous software communication components
Synchronous and asynchronous software communication componentsSynchronous and asynchronous software communication components
Synchronous and asynchronous software communication components
Panagiotis Tsilopoulos
 
Web 7 | HTTP Request and Response
Web 7 | HTTP Request and ResponseWeb 7 | HTTP Request and Response
Web 7 | HTTP Request and Response
Mohammad Imam Hossain
 
M enrichment
M enrichmentM enrichment
M enrichment
Vasanthii Chowdary
 
Mule connectors-session1
Mule connectors-session1Mule connectors-session1
Mule connectors-session1
Vishnukanth Rachineni
 
Mule connectors-part 1
Mule connectors-part 1Mule connectors-part 1
Mule connectors-part 1
VirtusaPolaris
 
Business Data Communications Infrastructure Networking and Security 7th Editi...
Business Data Communications Infrastructure Networking and Security 7th Editi...Business Data Communications Infrastructure Networking and Security 7th Editi...
Business Data Communications Infrastructure Networking and Security 7th Editi...
dzejlagirata
 
Mule enricher component
Mule enricher component Mule enricher component
Mule enricher component
Gandham38
 
Business Data Communications Infrastructure Networking and Security 7th Editi...
Business Data Communications Infrastructure Networking and Security 7th Editi...Business Data Communications Infrastructure Networking and Security 7th Editi...
Business Data Communications Infrastructure Networking and Security 7th Editi...
frohquely
 
Frequently asked MuleSoft Interview Questions and Answers from Techlightning
Frequently asked MuleSoft Interview Questions and Answers from TechlightningFrequently asked MuleSoft Interview Questions and Answers from Techlightning
Frequently asked MuleSoft Interview Questions and Answers from Techlightning
Arul ChristhuRaj Alphonse
 
Mule concepts
Mule conceptsMule concepts
Mule concepts
Sindhu VL
 
Software performance testing_overview
Software performance testing_overviewSoftware performance testing_overview
Software performance testing_overview
Rohan Bhattarai
 
Content based routing using mule choice flow control
Content based routing using mule choice flow controlContent based routing using mule choice flow control
Content based routing using mule choice flow control
Ankit Lawaniya
 
A short introduction on anypoint scopes
A short introduction on anypoint scopesA short introduction on anypoint scopes
A short introduction on anypoint scopes
Swapnil Sahu
 
Mule ESB Components
Mule ESB Components Mule ESB Components
Mule ESB Components
pat_91
 
Message structure
Message structureMessage structure
Message structure
Son Nguyen
 
Business Data Communications Infrastructure Networking and Security 7th Editi...
Business Data Communications Infrastructure Networking and Security 7th Editi...Business Data Communications Infrastructure Networking and Security 7th Editi...
Business Data Communications Infrastructure Networking and Security 7th Editi...
nyatiempilar
 
Until successful scope in mule
Until successful scope in muleUntil successful scope in mule
Until successful scope in mule
Ankit Lawaniya
 
Mule ESB Interview or Certification questions
Mule ESB Interview or Certification questionsMule ESB Interview or Certification questions
Mule ESB Interview or Certification questions
TechieVarsity
 
Composite source in mule
Composite source in muleComposite source in mule
Composite source in mule
Ankit Lawaniya
 
Synchronous and asynchronous software communication components
Synchronous and asynchronous software communication componentsSynchronous and asynchronous software communication components
Synchronous and asynchronous software communication components
Panagiotis Tsilopoulos
 
Mule connectors-part 1
Mule connectors-part 1Mule connectors-part 1
Mule connectors-part 1
VirtusaPolaris
 
Business Data Communications Infrastructure Networking and Security 7th Editi...
Business Data Communications Infrastructure Networking and Security 7th Editi...Business Data Communications Infrastructure Networking and Security 7th Editi...
Business Data Communications Infrastructure Networking and Security 7th Editi...
dzejlagirata
 
Mule enricher component
Mule enricher component Mule enricher component
Mule enricher component
Gandham38
 
Business Data Communications Infrastructure Networking and Security 7th Editi...
Business Data Communications Infrastructure Networking and Security 7th Editi...Business Data Communications Infrastructure Networking and Security 7th Editi...
Business Data Communications Infrastructure Networking and Security 7th Editi...
frohquely
 
Frequently asked MuleSoft Interview Questions and Answers from Techlightning
Frequently asked MuleSoft Interview Questions and Answers from TechlightningFrequently asked MuleSoft Interview Questions and Answers from Techlightning
Frequently asked MuleSoft Interview Questions and Answers from Techlightning
Arul ChristhuRaj Alphonse
 
Mule concepts
Mule conceptsMule concepts
Mule concepts
Sindhu VL
 
Software performance testing_overview
Software performance testing_overviewSoftware performance testing_overview
Software performance testing_overview
Rohan Bhattarai
 
Content based routing using mule choice flow control
Content based routing using mule choice flow controlContent based routing using mule choice flow control
Content based routing using mule choice flow control
Ankit Lawaniya
 
A short introduction on anypoint scopes
A short introduction on anypoint scopesA short introduction on anypoint scopes
A short introduction on anypoint scopes
Swapnil Sahu
 
Mule ESB Components
Mule ESB Components Mule ESB Components
Mule ESB Components
pat_91
 
Message structure
Message structureMessage structure
Message structure
Son Nguyen
 
Business Data Communications Infrastructure Networking and Security 7th Editi...
Business Data Communications Infrastructure Networking and Security 7th Editi...Business Data Communications Infrastructure Networking and Security 7th Editi...
Business Data Communications Infrastructure Networking and Security 7th Editi...
nyatiempilar
 
Until successful scope in mule
Until successful scope in muleUntil successful scope in mule
Until successful scope in mule
Ankit Lawaniya
 

More from Ankit Lawaniya (9)

First successful-router
First successful-routerFirst successful-router
First successful-router
Ankit Lawaniya
 
Iterative processing using the for each scope in
Iterative processing using the for each scope inIterative processing using the for each scope in
Iterative processing using the for each scope in
Ankit Lawaniya
 
Improving performance with cache scope in mule
Improving performance with cache scope in muleImproving performance with cache scope in mule
Improving performance with cache scope in mule
Ankit Lawaniya
 
Cors (cross origin request sharing) in mule
Cors (cross origin request sharing) in muleCors (cross origin request sharing) in mule
Cors (cross origin request sharing) in mule
Ankit Lawaniya
 
Validation module in mule
Validation module in muleValidation module in mule
Validation module in mule
Ankit Lawaniya
 
Schema validation filter (xml schema validation)
Schema validation filter (xml schema validation)Schema validation filter (xml schema validation)
Schema validation filter (xml schema validation)
Ankit Lawaniya
 
Validate json schema component
Validate json schema componentValidate json schema component
Validate json schema component
Ankit Lawaniya
 
Parse template transformer mule
Parse template transformer muleParse template transformer mule
Parse template transformer mule
Ankit Lawaniya
 
Active mq read and write flow in mule
Active mq  read and write flow in muleActive mq  read and write flow in mule
Active mq read and write flow in mule
Ankit Lawaniya
 
First successful-router
First successful-routerFirst successful-router
First successful-router
Ankit Lawaniya
 
Iterative processing using the for each scope in
Iterative processing using the for each scope inIterative processing using the for each scope in
Iterative processing using the for each scope in
Ankit Lawaniya
 
Improving performance with cache scope in mule
Improving performance with cache scope in muleImproving performance with cache scope in mule
Improving performance with cache scope in mule
Ankit Lawaniya
 
Cors (cross origin request sharing) in mule
Cors (cross origin request sharing) in muleCors (cross origin request sharing) in mule
Cors (cross origin request sharing) in mule
Ankit Lawaniya
 
Validation module in mule
Validation module in muleValidation module in mule
Validation module in mule
Ankit Lawaniya
 
Schema validation filter (xml schema validation)
Schema validation filter (xml schema validation)Schema validation filter (xml schema validation)
Schema validation filter (xml schema validation)
Ankit Lawaniya
 
Validate json schema component
Validate json schema componentValidate json schema component
Validate json schema component
Ankit Lawaniya
 
Parse template transformer mule
Parse template transformer muleParse template transformer mule
Parse template transformer mule
Ankit Lawaniya
 
Active mq read and write flow in mule
Active mq  read and write flow in muleActive mq  read and write flow in mule
Active mq read and write flow in mule
Ankit Lawaniya
 
Ad

Recently uploaded (20)

Generative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in BusinessGenerative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in Business
Dr. Tathagat Varma
 
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptxDevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
Justin Reock
 
Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)
Ortus Solutions, Corp
 
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven InsightsAndrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell
 
Procurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptxProcurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptx
Jon Hansen
 
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptxIncreasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Anoop Ashok
 
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdfSAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
Precisely
 
Role of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered ManufacturingRole of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered Manufacturing
Andrew Leo
 
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdfThe Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
Abi john
 
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdfComplete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Software Company
 
2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx
Samuele Fogagnolo
 
HCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser EnvironmentsHCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser Environments
panagenda
 
Technology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data AnalyticsTechnology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data Analytics
InData Labs
 
Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025
Splunk
 
TrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business ConsultingTrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business Consulting
Trs Labs
 
AI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global TrendsAI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global Trends
InData Labs
 
Linux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdfLinux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdf
RHCSA Guru
 
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Impelsys Inc.
 
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep DiveDesigning Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
ScyllaDB
 
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In FranceManifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
chb3
 
Generative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in BusinessGenerative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in Business
Dr. Tathagat Varma
 
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptxDevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
Justin Reock
 
Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)
Ortus Solutions, Corp
 
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven InsightsAndrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell
 
Procurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptxProcurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptx
Jon Hansen
 
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptxIncreasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Anoop Ashok
 
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdfSAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
Precisely
 
Role of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered ManufacturingRole of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered Manufacturing
Andrew Leo
 
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdfThe Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
Abi john
 
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdfComplete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Software Company
 
2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx
Samuele Fogagnolo
 
HCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser EnvironmentsHCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser Environments
panagenda
 
Technology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data AnalyticsTechnology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data Analytics
InData Labs
 
Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025
Splunk
 
TrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business ConsultingTrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business Consulting
Trs Labs
 
AI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global TrendsAI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global Trends
InData Labs
 
Linux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdfLinux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdf
RHCSA Guru
 
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Impelsys Inc.
 
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep DiveDesigning Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
ScyllaDB
 
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In FranceManifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
chb3
 
Ad

Content enrichment using mule message enricher

  • 2. Mule Message Enricher is one of the scopes in Mule which allows the current message to be augmented using data from a separate resource, which we call the Enrichment Resource. The Mule implementation of the Enrichment Resource (a source of data to augment the current message) can be any message processor. In simple language, we can say a message enricher enriches the current payload with some additional message or information and this is done without disturbing the current payload. Enricher is used if the target system needs more information than the source system can provide. It enriches the Mule message by calling an external system or doing some transformation to the existing payload and saving it into some scope of variable, like session, outbound, or invocation, and the transformation happening in the enricher scope doesn't affect the actual payload. Set-property: Save some information extracted from payload or original payload to some invocation or flow scope variable. 9/3/2017 Ankit Lawaniya 2
  • 4.  The Mule Message Enricher is designed for performing interactions like calling an outbound endpoint and bringing the result back to the main flow, which will be used to add the additional information into the existing payload.  One common scenario involves the need to enrich an incoming message with information that isn’t provided by the source system. You can use a content enricher if the target system needs more information than the source system can provide.  Mule Message Enricher allows the current message to be used in performing a particular task separately without disturbing the original message. Mule Message Enricher is best used in the case when you do not want to lose your existing payload. Example: If, in your flow, if you need to call an external service with an HTTP outbound/HTTP request component in middle of the flow after getting the response from the HTTP external service call you will find that your current payload is modified with the response of the external service, but you didn't want to change or disturb the existing payload. In that case, we can wrap our HTTP outbound/HTTP request component inside the enricher and it will make a call to the external system, store the result and your existing payload will not be modified. 9/3/2017 Ankit Lawaniya 4
  • 5. Below is the step by step process to demonstrate how Message Enricher works.  Enricher sends a copy of the original message into the processor.  The original message waits.  The copy is processed.  The copy's response is a message.  Part(s) of the response are added to part(s) of the original message.  The enriched message moves forward. 9/3/2017 Ankit Lawaniya 5
  • 6.  The way in which the message is enriched (or modified) is by explicitly configuring mappings (source->target) between the result from the Enrichment Resource and the message using Mule Expressions. Mule Expressions are used to both select the value to be extracted from the result that comes back from the Enrichment Resource (source) and to define where this value to be inserted into the message (target). The default source, if not configured, is the payload of the result from the Enrichment Resource. The “enrichment resource” can be any message processor, outbound connector, processor-chain, or flow-ref. If using an outbound-connector then, of course, it should have a request-response exchange pattern. 9/3/2017 Ankit Lawaniya 6
  • 7.  IMP Note: As only one component can reside inside Message Enricher, use of processor chain is recommended if more components are needed to reside inside Message Enricher. Let’s walk through how to use Mule Message Enricher in application. In this example, we are receiving the JSON Request consisting Employee data with id and role of the employee through HTTP call from the REST client. Our objective here is to add the additional information which is the name of the employee to the source data. For this, we will be calling Database to get the information about the employee name and that will be added in the source JSON to be sent back to the user. 9/3/2017 Ankit Lawaniya 7
  • 10.  Request: { "id": 1, "role": "Application Developer" }  Response: { "id": 1, "name": "Ankit", "Role": "Application Developer" } 9/3/2017 Ankit Lawaniya 10