SlideShare a Scribd company logo
MuleSoft ESB
Message Enricher
By
AKASH PRAJAPATI
Save Message/Payload for feature use/ Reference
Topics :
• Create Mule Project
• Add Message Enricher, Process Chain, Multiple Message Processors
Purpose :
Need to enrich an incoming message with information that isn’t provided by the source system. Use a
content enricher if the target system needs more information than the source system can provide.
Pre-requisites :
• Basic under standing of Mule ESB
• JDK 1.8 or above
• Anypoint Studio v 6.0.0 or above
• Mule Server v 3.8.0 EE or above
Create flow – httpServiceFlow :
Create flow – mainFlow :
Source File:
<?xml version="1.0" encoding="UTF-8"?>
<mule
xmlns:http="http://www.mulesoft.org/schema/mule/http"
xmlns="http://www.mulesoft.org/schema/mule/core"
xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
xmlns:spring="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd">
<http:listener-config name="HTTP_Listener_Configuration" host="0.0.0.0" port="9091" doc:name="HTTP Listener Configuration"/>
<http:request-config name="HTTP_Request_Configuration" host="localhost" port="9091" doc:name="HTTP Request Configuration"/>
<flow name="mainFlow">
<http:listener config-ref="HTTP_Listener_Configuration" path="/msgenricher" doc:name="HTTP"/>
<set-payload value="#['Original Payload']" doc:name="Set Payload"/>
<enricher source="#[payload]" target="#[flowVars.A]" doc:name="Message Enricher-1">
<processor-chain doc:name="Processor Chain-1">
<logger message="#['Message Enricher-1 : Start of Processor Chain -1']" level="INFO" doc:name="Logger"/>
<http:request config-ref="HTTP_Request_Configuration" path="/httpservice" method="POST" doc:name="HTTP">
<http:request-builder>
<http:query-param paramName="qp" value="#[payload]"/>
</http:request-builder>
</http:request>
<object-to-string-transformer doc:name="Object to String"/>
<set-payload value="#[payload]" doc:name="Set Payload"/>
<logger message="#['Message Enricher-1 : End of Processor Chain -1']" level="INFO" doc:name="Logger"/>
</processor-chain>
</enricher>
<logger message="#['In Between (Payload)=' + payload]" level="INFO" doc:name="Logger-Payload"/> <logger message="#['In Between Flow Variable (A)=' + flowVars.A]" level="INFO" doc:name="Logger - Flow Variable - A"/>
<enricher source="#[payload]" target="#[flowVars.B]" doc:name="Message Enricher-2">
<processor-chain doc:name="Processor Chain-A">
<logger message="#['Message Enricher-2 : Start of Processor Chain -A']" level="INFO" doc:name="Logger"/>
<set-payload value="#['Message Enricher-2 : Inside Processor Chain -A']" doc:name="Set Payload"/>
<logger message="#['Message Enricher-2 : End of Processor Chain -A']" level="INFO" doc:name="Logger"/>
</processor-chain>
</enricher>
<logger message="#[ 'Printing Payload=' + payload]" level="INFO" doc:name="Logger - Payload"/>
<logger message="#['Flow Variable (A)=' + flowVars.A]" level="INFO" doc:name="Logger - Flow Variable - A"/>
<logger message="#['Flow Variable (B)=' + flowVars.B]" level="INFO" doc:name="Logger - Flow Variable - B"/>
<logger message="#['================ End of Flow ================']" level="INFO" doc:name="Logger - Flow End"/>
</flow> <flow name="httpServiceFlow">
<http:listener config-ref="HTTP_Listener_Configuration" path="/httpservice" doc:name="HTTP"/>
<logger message="#['Flow - httpServiceFlow Query Param (qp)=' + message.inboundProperties.'http.query.params'.qp]" level="INFO" doc:name="Logger"/>
<set-payload value="#['HTTP REQ=' +message.inboundProperties.'http.query.params'.qp]" doc:name="Set Payload"/>
<logger message="#['End of Flow -httpServiceFlow']" level="INFO" doc:name="Logger"/>
</flow>
</mule>
Logger Information:
Try this URL again :
(*) http://localhost:9091/msgenricher
Response will be :
(*)
Note: Please validate log information and payload values.
------------------------ Thank You -------------------------

More Related Content

PPT
Anypoint connectorfor ibm as 400
PPTX
Mule jdbc
PPTX
Integrate with database by groovy
PPT
MuleSoft ESB Routes first-successful
PPTX
MuleSoft ESB scatter-gather and base64
ODP
Mule ESB SMTP Connector Integration
PPT
MuleSoft ESB Object Store
PPTX
Mule Esb Data Weave
Anypoint connectorfor ibm as 400
Mule jdbc
Integrate with database by groovy
MuleSoft ESB Routes first-successful
MuleSoft ESB scatter-gather and base64
Mule ESB SMTP Connector Integration
MuleSoft ESB Object Store
Mule Esb Data Weave

What's hot (14)

PPTX
Encrypting/Decrypting mule
PPTX
Mule esb
PPTX
Configurare http mule
PPT
Spring introduction
PPTX
Groovy example in mule
PPTX
Caching & validating
PPTX
Parameters as a part of body
ODP
Box connector Mule ESB Integration
PPTX
How to get http query parameters in mule
PPTX
Mulesoft Using Groovy Component
PPTX
Mule esb :Data Weave
PPTX
Mule new jdbc component
PPTX
MuleSoft ESB - CSV File to Database
PPTX
Compress and decompress
Encrypting/Decrypting mule
Mule esb
Configurare http mule
Spring introduction
Groovy example in mule
Caching & validating
Parameters as a part of body
Box connector Mule ESB Integration
How to get http query parameters in mule
Mulesoft Using Groovy Component
Mule esb :Data Weave
Mule new jdbc component
MuleSoft ESB - CSV File to Database
Compress and decompress
Ad

Viewers also liked (20)

PPTX
Mule concepts flows
PDF
How to connect redis and mule esb using spring data redis module
PPTX
Load balancer in mule
PPTX
Data weave more operations
PPTX
Mulesoftanypointplatformintro
PPT
Mulethenewtechnology 12549172699166-phpapp03-160421133841
ODP
PPTX
Xslt with mule
PPTX
Rest security in mule
PPTX
Using groovy in mule
PPTX
Query in share point by mule
PPTX
Cloud hub with mule
PPTX
Sap integration by mule esb
PPTX
Mule soa
PPTX
Mulesoft intergrate for android app
PPTX
Mule any point studio
PPTX
Scatter gather flow in mule
PPTX
Running mule standalone
PPTX
Mule sap connector
PPTX
WSDL in Mule Esb
Mule concepts flows
How to connect redis and mule esb using spring data redis module
Load balancer in mule
Data weave more operations
Mulesoftanypointplatformintro
Mulethenewtechnology 12549172699166-phpapp03-160421133841
Xslt with mule
Rest security in mule
Using groovy in mule
Query in share point by mule
Cloud hub with mule
Sap integration by mule esb
Mule soa
Mulesoft intergrate for android app
Mule any point studio
Scatter gather flow in mule
Running mule standalone
Mule sap connector
WSDL in Mule Esb
Ad

Similar to MuleSoft ESB Message Enricher (20)

PDF
MuleSoft ESB Payload Encrypt Decrypt using anypoint enterprise security
PPTX
MuleSoft ESB Scripting Example
PPTX
Mule esb Data Weave
 
PPTX
Mule esb
PPTX
Mule esb:DataWeave
PPTX
Mule esb dataweave
PPTX
Mule esb :Data Weave
PPTX
Mule esb
PPTX
Mule esb
PPTX
Mule esb DataWeave
PPTX
Mule esb
PPT
MuleSoft ESB XML to CSV
PPT
MuleSoft ESB CSV to XML
PPTX
Windows Phone 8 - 9 Push Notifications
PPTX
How to use Cache scope
PPTX
Mule xml java
PPTX
Mule xml java
PPTX
How to use database component using stored procedure call
PPTX
Mule xml parsing
PPTX
Mule xml parsing
MuleSoft ESB Payload Encrypt Decrypt using anypoint enterprise security
MuleSoft ESB Scripting Example
Mule esb Data Weave
 
Mule esb
Mule esb:DataWeave
Mule esb dataweave
Mule esb :Data Weave
Mule esb
Mule esb
Mule esb DataWeave
Mule esb
MuleSoft ESB XML to CSV
MuleSoft ESB CSV to XML
Windows Phone 8 - 9 Push Notifications
How to use Cache scope
Mule xml java
Mule xml java
How to use database component using stored procedure call
Mule xml parsing
Mule xml parsing

More from akashdprajapati (7)

PPTX
MuleSoft ESB Payload Encrypt using Anypoint Security
PDF
MuleSoft ESB Shared Library
PPTX
MuleSoft ESB Filtering data instead of Looping
PPTX
MuleSoft ESB Sending email using hmailserver
PPTX
Mule Soft ESB - SAP Outbound
PPTX
MuleSoft ESB Testing Mule Application using MUnit Test Suite
PPTX
MuleSoft ESB Composite Source
MuleSoft ESB Payload Encrypt using Anypoint Security
MuleSoft ESB Shared Library
MuleSoft ESB Filtering data instead of Looping
MuleSoft ESB Sending email using hmailserver
Mule Soft ESB - SAP Outbound
MuleSoft ESB Testing Mule Application using MUnit Test Suite
MuleSoft ESB Composite Source

Recently uploaded (20)

PDF
STATICS OF THE RIGID BODIES Hibbelers.pdf
PPTX
Introduction to Child Health Nursing – Unit I | Child Health Nursing I | B.Sc...
PDF
Module 4: Burden of Disease Tutorial Slides S2 2025
PDF
Classroom Observation Tools for Teachers
PPTX
Microbial diseases, their pathogenesis and prophylaxis
PDF
RMMM.pdf make it easy to upload and study
PPTX
Institutional Correction lecture only . . .
PPTX
Renaissance Architecture: A Journey from Faith to Humanism
PDF
TR - Agricultural Crops Production NC III.pdf
PDF
Abdominal Access Techniques with Prof. Dr. R K Mishra
PDF
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
PDF
O5-L3 Freight Transport Ops (International) V1.pdf
PDF
2.FourierTransform-ShortQuestionswithAnswers.pdf
PPTX
Cell Structure & Organelles in detailed.
PDF
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
PDF
Anesthesia in Laparoscopic Surgery in India
PDF
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
PDF
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
PDF
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
PDF
Mark Klimek Lecture Notes_240423 revision books _173037.pdf
STATICS OF THE RIGID BODIES Hibbelers.pdf
Introduction to Child Health Nursing – Unit I | Child Health Nursing I | B.Sc...
Module 4: Burden of Disease Tutorial Slides S2 2025
Classroom Observation Tools for Teachers
Microbial diseases, their pathogenesis and prophylaxis
RMMM.pdf make it easy to upload and study
Institutional Correction lecture only . . .
Renaissance Architecture: A Journey from Faith to Humanism
TR - Agricultural Crops Production NC III.pdf
Abdominal Access Techniques with Prof. Dr. R K Mishra
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
O5-L3 Freight Transport Ops (International) V1.pdf
2.FourierTransform-ShortQuestionswithAnswers.pdf
Cell Structure & Organelles in detailed.
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
Anesthesia in Laparoscopic Surgery in India
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
Mark Klimek Lecture Notes_240423 revision books _173037.pdf

MuleSoft ESB Message Enricher

  • 2. Save Message/Payload for feature use/ Reference Topics : • Create Mule Project • Add Message Enricher, Process Chain, Multiple Message Processors Purpose : Need to enrich an incoming message with information that isn’t provided by the source system. Use a content enricher if the target system needs more information than the source system can provide. Pre-requisites : • Basic under standing of Mule ESB • JDK 1.8 or above • Anypoint Studio v 6.0.0 or above • Mule Server v 3.8.0 EE or above
  • 3. Create flow – httpServiceFlow :
  • 4. Create flow – mainFlow :
  • 5. Source File: <?xml version="1.0" encoding="UTF-8"?> <mule xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation" xmlns:spring="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd"> <http:listener-config name="HTTP_Listener_Configuration" host="0.0.0.0" port="9091" doc:name="HTTP Listener Configuration"/> <http:request-config name="HTTP_Request_Configuration" host="localhost" port="9091" doc:name="HTTP Request Configuration"/> <flow name="mainFlow"> <http:listener config-ref="HTTP_Listener_Configuration" path="/msgenricher" doc:name="HTTP"/> <set-payload value="#['Original Payload']" doc:name="Set Payload"/> <enricher source="#[payload]" target="#[flowVars.A]" doc:name="Message Enricher-1"> <processor-chain doc:name="Processor Chain-1"> <logger message="#['Message Enricher-1 : Start of Processor Chain -1']" level="INFO" doc:name="Logger"/> <http:request config-ref="HTTP_Request_Configuration" path="/httpservice" method="POST" doc:name="HTTP"> <http:request-builder> <http:query-param paramName="qp" value="#[payload]"/> </http:request-builder> </http:request> <object-to-string-transformer doc:name="Object to String"/> <set-payload value="#[payload]" doc:name="Set Payload"/> <logger message="#['Message Enricher-1 : End of Processor Chain -1']" level="INFO" doc:name="Logger"/> </processor-chain> </enricher> <logger message="#['In Between (Payload)=' + payload]" level="INFO" doc:name="Logger-Payload"/> <logger message="#['In Between Flow Variable (A)=' + flowVars.A]" level="INFO" doc:name="Logger - Flow Variable - A"/> <enricher source="#[payload]" target="#[flowVars.B]" doc:name="Message Enricher-2"> <processor-chain doc:name="Processor Chain-A"> <logger message="#['Message Enricher-2 : Start of Processor Chain -A']" level="INFO" doc:name="Logger"/> <set-payload value="#['Message Enricher-2 : Inside Processor Chain -A']" doc:name="Set Payload"/> <logger message="#['Message Enricher-2 : End of Processor Chain -A']" level="INFO" doc:name="Logger"/> </processor-chain> </enricher> <logger message="#[ 'Printing Payload=' + payload]" level="INFO" doc:name="Logger - Payload"/> <logger message="#['Flow Variable (A)=' + flowVars.A]" level="INFO" doc:name="Logger - Flow Variable - A"/> <logger message="#['Flow Variable (B)=' + flowVars.B]" level="INFO" doc:name="Logger - Flow Variable - B"/> <logger message="#['================ End of Flow ================']" level="INFO" doc:name="Logger - Flow End"/> </flow> <flow name="httpServiceFlow"> <http:listener config-ref="HTTP_Listener_Configuration" path="/httpservice" doc:name="HTTP"/> <logger message="#['Flow - httpServiceFlow Query Param (qp)=' + message.inboundProperties.'http.query.params'.qp]" level="INFO" doc:name="Logger"/> <set-payload value="#['HTTP REQ=' +message.inboundProperties.'http.query.params'.qp]" doc:name="Set Payload"/> <logger message="#['End of Flow -httpServiceFlow']" level="INFO" doc:name="Logger"/> </flow> </mule>
  • 6. Logger Information: Try this URL again : (*) http://localhost:9091/msgenricher Response will be : (*) Note: Please validate log information and payload values. ------------------------ Thank You -------------------------