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

More Related Content

Similar to Content enrichment using mule message enricher

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
 
Mule enricher component
Mule enricher component Mule enricher component
Mule enricher component
Gandham38
 
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_overviewRohan 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
 
Until successful scope in mule
Until successful scope in muleUntil successful scope in mule
Until successful scope in mule
Ankit Lawaniya
 
Mule message structure
Mule message structureMule message structure
Mule message structure
Shanky Gupta
 
Routing in mule
Routing in muleRouting in mule
Routing in mule
Hari Gatadi
 
Types of MessageRouting in Mule
Types of MessageRouting in MuleTypes of MessageRouting in Mule
Types of MessageRouting in Mule
VenkataNaveen Kumar
 

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
 
Composite source in mule
Composite source in muleComposite source in mule
Composite source in mule
 
Mule fundamentals
Mule fundamentalsMule fundamentals
Mule fundamentals
 
Synchronous and asynchronous software communication components
Synchronous and asynchronous software communication componentsSynchronous and asynchronous software communication components
Synchronous and asynchronous software communication components
 
Web 7 | HTTP Request and Response
Web 7 | HTTP Request and ResponseWeb 7 | HTTP Request and Response
Web 7 | HTTP Request and Response
 
M enrichment
M enrichmentM enrichment
M enrichment
 
Mule connectors-session1
Mule connectors-session1Mule connectors-session1
Mule connectors-session1
 
Mule connectors-part 1
Mule connectors-part 1Mule connectors-part 1
Mule connectors-part 1
 
Mule enricher component
Mule enricher component Mule enricher component
Mule enricher component
 
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
 
Mule concepts
Mule conceptsMule concepts
Mule concepts
 
Software performance testing_overview
Software performance testing_overviewSoftware performance testing_overview
Software performance testing_overview
 
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
 
A short introduction on anypoint scopes
A short introduction on anypoint scopesA short introduction on anypoint scopes
A short introduction on anypoint scopes
 
Mule ESB Components
Mule ESB Components Mule ESB Components
Mule ESB Components
 
Message structure
Message structureMessage structure
Message structure
 
Until successful scope in mule
Until successful scope in muleUntil successful scope in mule
Until successful scope in mule
 
Mule message structure
Mule message structureMule message structure
Mule message structure
 
Routing in mule
Routing in muleRouting in mule
Routing in mule
 
Types of MessageRouting in Mule
Types of MessageRouting in MuleTypes of MessageRouting in Mule
Types of MessageRouting in Mule
 

More from 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
 

More from Ankit Lawaniya (9)

First successful-router
First successful-routerFirst successful-router
First successful-router
 
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
 
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
 
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
 
Validation module in mule
Validation module in muleValidation module in mule
Validation module in mule
 
Schema validation filter (xml schema validation)
Schema validation filter (xml schema validation)Schema validation filter (xml schema validation)
Schema validation filter (xml schema validation)
 
Validate json schema component
Validate json schema componentValidate json schema component
Validate json schema component
 
Parse template transformer mule
Parse template transformer muleParse template transformer mule
Parse template transformer mule
 
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
 

Recently uploaded

Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
RTTS
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
Product School
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
Product School
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
Sri Ambati
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
DianaGray10
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Jeffrey Haguewood
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
Product School
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
OnBoard
 
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
Abida Shariff
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Thierry Lestable
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Product School
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi
Fwdays
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
Cheryl Hung
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
Product School
 
ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User Group
CatarinaPereira64715
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Inflectra
 

Recently uploaded (20)

Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
 
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
 
ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User Group
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
 

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