SlideShare a Scribd company logo
1 of 7
MuleSoft ESB
Routers - First Successful
By
AKASH PRAJAPATI
Topics :
•Routers (Flow Controls in Anypoint Studio) route messages to various destinations in a Mule flow.
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
Purpose:
•Routers (Flow Controls in Anypoint Studio) route messages to various destinations in a Mule flow using First Successful.
- 3 -
First Successful :
Sends a message to the next message processor within a "circular" list of processor targets.
The First Successful message processor iterates through its list of child message processors, routing a received message to each of
them in order until one processes the message successfully. If none succeed, an exception is thrown.
Success is defined as:
If the child message processor throws an exception, this is a failure.
Otherwise:
• If the child message processor returns a message that contains an exception payload, this is a failure.
• If the child message processor returns a message that does not contain an exception payload, this is a success.
• If the child message processor does not return a message (e.g. is a one-way connector), this is a success.
First Successful – Routes :
Flows :
1 2
<context:property-placeholder location="prop-dev.properties"/>
<http:listener-config name="HTTP_Listener_Configuration" host="${env.prop.hostname}" port="${env.prop.post}" doc:name="HTTP Listener Configuration“ />
<http:request-config name="HTTP_Request_Configuration_A" host="${env.prop.hostname}" port="${env.prop.post}" doc:name="HTTP Request Configuration" />
<http:request-config name="HTTP_Request_Configuration_B" host="${env.prop.hostname}" port="${env.prop.post}" doc:name="HTTP Request Configuration" />
<http:request-config name="HTTP_Request_Configuration_C" host="${env.prop.hostname}" port="${env.prop.post}" doc:name="HTTP Request Configuration" />
- 5 -
Flows : 1
<flow name="labsessionFlow">
<http:listener config-ref="HTTP_Listener_Configuration" path="/labsession" doc:name="HTTP"/>
<logger message="******************* START OF FLOW *******************" level="INFO" doc:name="Logger"/>
<set-payload value="#[message.inboundProperties.'http.query.params'.name]" doc:name="Set Payload"/>
<append-string-transformer message=", Welcome...!!!" doc:name="Append String"/>
<logger message="#[payload]" level="INFO" doc:name="Logger"/>
<logger message="******************* END OF FLOW *******************" level="INFO" doc:name="Logger"/>
</flow>
URL : http://localhost:9091/labsession?name=<<YourName>>
Flow : 2
<flow name="firstSuccessfulFlow">
<http:listener config-ref="HTTP_Listener_Configuration" path="/catalog" doc:name="HTTP"/>
<logger message="#['Start of flow']" level="INFO" doc:name="Logger"/>
<set-payload value="#['Set Payload - Replay Webservice Flow']" doc:name="Set Payload"/>
<first-successful doc:name="First Successful">
<http:request config-ref="HTTP_Request_Configuration_A" path="/labsession1?name=Param1" method="GET" doc:name="HTTP" />
<http:request config-ref="HTTP_Request_Configuration_B" path="/labsession2?name=Param2" method="GET" doc:name="HTTP" />
<http:request config-ref="HTTP_Request_Configuration_C" path="/labsession?name=Akash" method="GET" doc:name="HTTP" />
<logger message="#['--- In First Successful ---']" level="INFO" doc:name="Logger"/>
</first-successful>
<set-payload doc:name="Set Payload" value="#[payload]"/>
<logger message="#['End of flow' + payload ]" level="INFO" doc:name="Logger"/>
</flow>
URL : http://localhost:9091/catalog
Logger Information:
Steps:
(*) Run URL : http://localhost:9091/catalog
(*) Validate Log and Payload values
---------------------------------------------------------- Thank You ----------------------------------------------------------

More Related Content

What's hot

Mule esb
Mule esbMule esb
Mule esbKhan625
 
How to get http query parameters in mule
How to get http query parameters in muleHow to get http query parameters in mule
How to get http query parameters in muleRamakrishna kapa
 
Message properties component in Mule
Message properties component in MuleMessage properties component in Mule
Message properties component in MuleKhan625
 
For each component in mule
For each component in muleFor each component in mule
For each component in muleRajkattamuri
 
Anypoint connectorfor ibm as 400
Anypoint connectorfor ibm as 400Anypoint connectorfor ibm as 400
Anypoint connectorfor ibm as 400himajareddys
 
Choice component in mule
Choice component in mule Choice component in mule
Choice component in mule Rajkattamuri
 
Junit in mule demo
Junit in mule demo Junit in mule demo
Junit in mule demo javeed_mhd
 
Mule ESB SMTP Connector Integration
Mule ESB SMTP Connector  IntegrationMule ESB SMTP Connector  Integration
Mule ESB SMTP Connector IntegrationAnilKumar Etagowni
 
Dropbox connector Mule ESB Integration
Dropbox connector Mule ESB IntegrationDropbox connector Mule ESB Integration
Dropbox connector Mule ESB IntegrationAnilKumar Etagowni
 
Mule Esb Data Weave
Mule Esb Data WeaveMule Esb Data Weave
Mule Esb Data WeaveMohammed246
 
Expression filter in Mule
Expression filter in MuleExpression filter in Mule
Expression filter in MuleMohammed246
 
Basic example using for each component
Basic example using for each componentBasic example using for each component
Basic example using for each componentprudhvivreddy
 
Mulesoft Using Groovy Component
Mulesoft Using Groovy ComponentMulesoft Using Groovy Component
Mulesoft Using Groovy Componentkumar gaurav
 

What's hot (15)

Mule esb
Mule esbMule esb
Mule esb
 
How to get http query parameters in mule
How to get http query parameters in muleHow to get http query parameters in mule
How to get http query parameters in mule
 
Message properties component in Mule
Message properties component in MuleMessage properties component in Mule
Message properties component in Mule
 
For each component in mule
For each component in muleFor each component in mule
For each component in mule
 
Anypoint connectorfor ibm as 400
Anypoint connectorfor ibm as 400Anypoint connectorfor ibm as 400
Anypoint connectorfor ibm as 400
 
Choice component in mule
Choice component in mule Choice component in mule
Choice component in mule
 
Junit in mule demo
Junit in mule demo Junit in mule demo
Junit in mule demo
 
Mule ESB SMTP Connector Integration
Mule ESB SMTP Connector  IntegrationMule ESB SMTP Connector  Integration
Mule ESB SMTP Connector Integration
 
Mule jdbc
Mule   jdbcMule   jdbc
Mule jdbc
 
Dropbox connector Mule ESB Integration
Dropbox connector Mule ESB IntegrationDropbox connector Mule ESB Integration
Dropbox connector Mule ESB Integration
 
Mule Esb Data Weave
Mule Esb Data WeaveMule Esb Data Weave
Mule Esb Data Weave
 
Expression filter in Mule
Expression filter in MuleExpression filter in Mule
Expression filter in Mule
 
Basic example using for each component
Basic example using for each componentBasic example using for each component
Basic example using for each component
 
Mulesoft Using Groovy Component
Mulesoft Using Groovy ComponentMulesoft Using Groovy Component
Mulesoft Using Groovy Component
 
Mule esb :Data Weave
Mule esb :Data WeaveMule esb :Data Weave
Mule esb :Data Weave
 

Similar to MuleSoft ESB Routes first-successful

Until successful scope in mule
Until successful scope in muleUntil successful scope in mule
Until successful scope in muleAnkit Lawaniya
 
Migrating to Prometheus: what we learned running it in production
Migrating to Prometheus: what we learned running it in productionMigrating to Prometheus: what we learned running it in production
Migrating to Prometheus: what we learned running it in productionMarco Pracucci
 
Performance Testing - Apache Benchmark, JMeter
Performance Testing  - Apache Benchmark, JMeterPerformance Testing  - Apache Benchmark, JMeter
Performance Testing - Apache Benchmark, JMeterAntoni Orfin
 
Load Balancing with Apache
Load Balancing with ApacheLoad Balancing with Apache
Load Balancing with ApacheBradley Holt
 
How to use database component using stored procedure call
How to use database component using stored procedure callHow to use database component using stored procedure call
How to use database component using stored procedure callprathyusha vadla
 
Spring Boot and REST API
Spring Boot and REST APISpring Boot and REST API
Spring Boot and REST API07.pallav
 
Puppet Camp Charlotte 2015: Exporting Resources: There and Back Again
Puppet Camp Charlotte 2015: Exporting Resources: There and Back AgainPuppet Camp Charlotte 2015: Exporting Resources: There and Back Again
Puppet Camp Charlotte 2015: Exporting Resources: There and Back AgainPuppet
 
Reverse proxies & Inconsistency
Reverse proxies & InconsistencyReverse proxies & Inconsistency
Reverse proxies & InconsistencyGreenD0g
 
Spring JMS and ActiveMQ
Spring JMS and ActiveMQSpring JMS and ActiveMQ
Spring JMS and ActiveMQGeert Pante
 
Effective out-of-container Integration Testing
Effective out-of-container Integration TestingEffective out-of-container Integration Testing
Effective out-of-container Integration TestingSam Brannen
 
nodejs_at_a_glance.ppt
nodejs_at_a_glance.pptnodejs_at_a_glance.ppt
nodejs_at_a_glance.pptWalaSidhom1
 
Webservices Workshop - september 2014
Webservices Workshop -  september 2014Webservices Workshop -  september 2014
Webservices Workshop - september 2014clairvoyantllc
 

Similar to MuleSoft ESB Routes first-successful (20)

Until successful scope in mule
Until successful scope in muleUntil successful scope in mule
Until successful scope in mule
 
Migrating to Prometheus: what we learned running it in production
Migrating to Prometheus: what we learned running it in productionMigrating to Prometheus: what we learned running it in production
Migrating to Prometheus: what we learned running it in production
 
Performance Testing - Apache Benchmark, JMeter
Performance Testing  - Apache Benchmark, JMeterPerformance Testing  - Apache Benchmark, JMeter
Performance Testing - Apache Benchmark, JMeter
 
Load Balancing with Apache
Load Balancing with ApacheLoad Balancing with Apache
Load Balancing with Apache
 
How to use database component using stored procedure call
How to use database component using stored procedure callHow to use database component using stored procedure call
How to use database component using stored procedure call
 
Spring Boot and REST API
Spring Boot and REST APISpring Boot and REST API
Spring Boot and REST API
 
Puppet Camp Charlotte 2015: Exporting Resources: There and Back Again
Puppet Camp Charlotte 2015: Exporting Resources: There and Back AgainPuppet Camp Charlotte 2015: Exporting Resources: There and Back Again
Puppet Camp Charlotte 2015: Exporting Resources: There and Back Again
 
Reverse proxies & Inconsistency
Reverse proxies & InconsistencyReverse proxies & Inconsistency
Reverse proxies & Inconsistency
 
Spring JMS and ActiveMQ
Spring JMS and ActiveMQSpring JMS and ActiveMQ
Spring JMS and ActiveMQ
 
Effective out-of-container Integration Testing
Effective out-of-container Integration TestingEffective out-of-container Integration Testing
Effective out-of-container Integration Testing
 
nodejs_at_a_glance.ppt
nodejs_at_a_glance.pptnodejs_at_a_glance.ppt
nodejs_at_a_glance.ppt
 
ASP.NET WEB API
ASP.NET WEB APIASP.NET WEB API
ASP.NET WEB API
 
Webservices Workshop - september 2014
Webservices Workshop -  september 2014Webservices Workshop -  september 2014
Webservices Workshop - september 2014
 
Mule smtp connector
Mule smtp connectorMule smtp connector
Mule smtp connector
 
Liferay Message Bus
Liferay Message BusLiferay Message Bus
Liferay Message Bus
 
Mulexml java
Mulexml javaMulexml java
Mulexml java
 
Mule XML java sample
Mule XML java sampleMule XML java sample
Mule XML java sample
 
Spring integration
Spring integrationSpring integration
Spring integration
 
Mule esb
Mule esbMule esb
Mule esb
 
Mule esb DataWeave
Mule esb DataWeaveMule esb DataWeave
Mule esb DataWeave
 

More from akashdprajapati

MuleSoft ESB Payload Encrypt using Anypoint Security
MuleSoft ESB Payload Encrypt using Anypoint SecurityMuleSoft ESB Payload Encrypt using Anypoint Security
MuleSoft ESB Payload Encrypt using Anypoint Securityakashdprajapati
 
MuleSoft ESB Shared Library
MuleSoft ESB Shared LibraryMuleSoft ESB Shared Library
MuleSoft ESB Shared Libraryakashdprajapati
 
MuleSoft ESB Filtering data instead of Looping
MuleSoft ESB Filtering data instead of LoopingMuleSoft ESB Filtering data instead of Looping
MuleSoft ESB Filtering data instead of Loopingakashdprajapati
 
MuleSoft ESB Payload Encrypt Decrypt using anypoint enterprise security
MuleSoft ESB Payload Encrypt Decrypt using anypoint enterprise securityMuleSoft ESB Payload Encrypt Decrypt using anypoint enterprise security
MuleSoft ESB Payload Encrypt Decrypt using anypoint enterprise securityakashdprajapati
 
MuleSoft ESB Sending email using hmailserver
MuleSoft ESB Sending email using hmailserverMuleSoft ESB Sending email using hmailserver
MuleSoft ESB Sending email using hmailserverakashdprajapati
 
Mule Soft ESB - SAP Outbound
Mule Soft ESB - SAP OutboundMule Soft ESB - SAP Outbound
Mule Soft ESB - SAP Outboundakashdprajapati
 
MuleSoft ESB scatter-gather and base64
MuleSoft ESB scatter-gather and base64MuleSoft ESB scatter-gather and base64
MuleSoft ESB scatter-gather and base64akashdprajapati
 
MuleSoft ESB Testing Mule Application using MUnit Test Suite
MuleSoft ESB Testing Mule Application using MUnit Test SuiteMuleSoft ESB Testing Mule Application using MUnit Test Suite
MuleSoft ESB Testing Mule Application using MUnit Test Suiteakashdprajapati
 
MuleSoft ESB Composite Source
MuleSoft ESB Composite SourceMuleSoft ESB Composite Source
MuleSoft ESB Composite Sourceakashdprajapati
 
MuleSoft ESB - CSV File to Database
MuleSoft ESB - CSV File to DatabaseMuleSoft ESB - CSV File to Database
MuleSoft ESB - CSV File to Databaseakashdprajapati
 

More from akashdprajapati (10)

MuleSoft ESB Payload Encrypt using Anypoint Security
MuleSoft ESB Payload Encrypt using Anypoint SecurityMuleSoft ESB Payload Encrypt using Anypoint Security
MuleSoft ESB Payload Encrypt using Anypoint Security
 
MuleSoft ESB Shared Library
MuleSoft ESB Shared LibraryMuleSoft ESB Shared Library
MuleSoft ESB Shared Library
 
MuleSoft ESB Filtering data instead of Looping
MuleSoft ESB Filtering data instead of LoopingMuleSoft ESB Filtering data instead of Looping
MuleSoft ESB Filtering data instead of Looping
 
MuleSoft ESB Payload Encrypt Decrypt using anypoint enterprise security
MuleSoft ESB Payload Encrypt Decrypt using anypoint enterprise securityMuleSoft ESB Payload Encrypt Decrypt using anypoint enterprise security
MuleSoft ESB Payload Encrypt Decrypt using anypoint enterprise security
 
MuleSoft ESB Sending email using hmailserver
MuleSoft ESB Sending email using hmailserverMuleSoft ESB Sending email using hmailserver
MuleSoft ESB Sending email using hmailserver
 
Mule Soft ESB - SAP Outbound
Mule Soft ESB - SAP OutboundMule Soft ESB - SAP Outbound
Mule Soft ESB - SAP Outbound
 
MuleSoft ESB scatter-gather and base64
MuleSoft ESB scatter-gather and base64MuleSoft ESB scatter-gather and base64
MuleSoft ESB scatter-gather and base64
 
MuleSoft ESB Testing Mule Application using MUnit Test Suite
MuleSoft ESB Testing Mule Application using MUnit Test SuiteMuleSoft ESB Testing Mule Application using MUnit Test Suite
MuleSoft ESB Testing Mule Application using MUnit Test Suite
 
MuleSoft ESB Composite Source
MuleSoft ESB Composite SourceMuleSoft ESB Composite Source
MuleSoft ESB Composite Source
 
MuleSoft ESB - CSV File to Database
MuleSoft ESB - CSV File to DatabaseMuleSoft ESB - CSV File to Database
MuleSoft ESB - CSV File to Database
 

Recently uploaded

Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphThiyagu K
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Celine George
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDThiyagu K
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...anjaliyadav012327
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...fonyou31
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 

Recently uploaded (20)

Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 

MuleSoft ESB Routes first-successful

  • 1. MuleSoft ESB Routers - First Successful By AKASH PRAJAPATI
  • 2. Topics : •Routers (Flow Controls in Anypoint Studio) route messages to various destinations in a Mule flow. 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 Purpose: •Routers (Flow Controls in Anypoint Studio) route messages to various destinations in a Mule flow using First Successful.
  • 3. - 3 - First Successful : Sends a message to the next message processor within a "circular" list of processor targets. The First Successful message processor iterates through its list of child message processors, routing a received message to each of them in order until one processes the message successfully. If none succeed, an exception is thrown. Success is defined as: If the child message processor throws an exception, this is a failure. Otherwise: • If the child message processor returns a message that contains an exception payload, this is a failure. • If the child message processor returns a message that does not contain an exception payload, this is a success. • If the child message processor does not return a message (e.g. is a one-way connector), this is a success. First Successful – Routes :
  • 4. Flows : 1 2 <context:property-placeholder location="prop-dev.properties"/> <http:listener-config name="HTTP_Listener_Configuration" host="${env.prop.hostname}" port="${env.prop.post}" doc:name="HTTP Listener Configuration“ /> <http:request-config name="HTTP_Request_Configuration_A" host="${env.prop.hostname}" port="${env.prop.post}" doc:name="HTTP Request Configuration" /> <http:request-config name="HTTP_Request_Configuration_B" host="${env.prop.hostname}" port="${env.prop.post}" doc:name="HTTP Request Configuration" /> <http:request-config name="HTTP_Request_Configuration_C" host="${env.prop.hostname}" port="${env.prop.post}" doc:name="HTTP Request Configuration" />
  • 5. - 5 - Flows : 1 <flow name="labsessionFlow"> <http:listener config-ref="HTTP_Listener_Configuration" path="/labsession" doc:name="HTTP"/> <logger message="******************* START OF FLOW *******************" level="INFO" doc:name="Logger"/> <set-payload value="#[message.inboundProperties.'http.query.params'.name]" doc:name="Set Payload"/> <append-string-transformer message=", Welcome...!!!" doc:name="Append String"/> <logger message="#[payload]" level="INFO" doc:name="Logger"/> <logger message="******************* END OF FLOW *******************" level="INFO" doc:name="Logger"/> </flow> URL : http://localhost:9091/labsession?name=<<YourName>>
  • 6. Flow : 2 <flow name="firstSuccessfulFlow"> <http:listener config-ref="HTTP_Listener_Configuration" path="/catalog" doc:name="HTTP"/> <logger message="#['Start of flow']" level="INFO" doc:name="Logger"/> <set-payload value="#['Set Payload - Replay Webservice Flow']" doc:name="Set Payload"/> <first-successful doc:name="First Successful"> <http:request config-ref="HTTP_Request_Configuration_A" path="/labsession1?name=Param1" method="GET" doc:name="HTTP" /> <http:request config-ref="HTTP_Request_Configuration_B" path="/labsession2?name=Param2" method="GET" doc:name="HTTP" /> <http:request config-ref="HTTP_Request_Configuration_C" path="/labsession?name=Akash" method="GET" doc:name="HTTP" /> <logger message="#['--- In First Successful ---']" level="INFO" doc:name="Logger"/> </first-successful> <set-payload doc:name="Set Payload" value="#[payload]"/> <logger message="#['End of flow' + payload ]" level="INFO" doc:name="Logger"/> </flow> URL : http://localhost:9091/catalog
  • 7. Logger Information: Steps: (*) Run URL : http://localhost:9091/catalog (*) Validate Log and Payload values ---------------------------------------------------------- Thank You ----------------------------------------------------------