SlideShare a Scribd company logo
Basic Example Using
Until Successful
Component
Introduction
The until-successful scope processes messages
through the processors within it until the process
succeeds. By default, until-successful’s processing
occurs asynchronously from the main flow. After
passing a message into the until-successful scope, the
main flow immediately regains control of the thread.
However, you can configure until-successful to run
synchronously relative to the main flow.
FLOW
FLOW:
XML:
<?xml version="1.0" encoding="UTF-8"?><mule xmlns:vm="http://www.mulesoft.org/schema/mule/vm" xmlns:jdbc-
ee="http://www.mulesoft.org/schema/mule/ee/jdbc" 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" version="EE-3.4.0" 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://www.mulesoft.org/schema/mule/ee/jdbc http://www.mulesoft.org/schema/mule/ee/jdbc/current/mule-jdbc-ee.xsd
http://www.mulesoft.org/schema/mule/vm http://www.mulesoft.org/schema/mule/vm/current/mule-vm.xsd">
<jdbc-ee:mssql-data-source name="MS_SQL_Data_Source" user=“****" password=“****" url="jdbc:sqlserver://localhost;databaseName=test1"
transactionIsolation="UNSPECIFIED" doc:name="MS SQL Data Source"/>
<jdbc-ee:connector name="Database" dataSource-ref="MS_SQL_Data_Source" validateConnections="true" queryTimeout="-1" pollingFrequency="0"
doc:name="Database"/>
<spring:beans>
<spring:bean id="Bean" name="Bean" class="org.mule.util.store.SimpleMemoryObjectStore"/>
</spring:beans>
<flow name="Database_ComponentFlow2" doc:name="Database_ComponentFlow2">
<http:inbound-endpoint exchange-pattern="request-response" host="localhost" port="8080" path="US" doc:name="HTTP"/>
<logger message="--main flow--" level="INFO" doc:name="Logger"/>
<expression-component doc:name="Expression"><![CDATA[
sessionVars['DB_STATUS']='INITIAL';
]]></expression-component>
<until-successful objectStore-ref="Bean" maxRetries="5" secondsBetweenRetries="5" doc:name="Until Successful"
failureExpression="#[sessionVars['DB_STATUS']!='SUCCESS']">
<vm:outbound-endpoint exchange-pattern="request-response" path="db" doc:name="VM"/>
</until-successful>
</flow>
<flow name="Database_ComponentFlow3" doc:name="Database_ComponentFlow3">
<vm:inbound-endpoint exchange-pattern="request-response" path="db" doc:name="VM"/>
<jdbc-ee:outbound-endpoint exchange-pattern="request-response" queryKey="select" queryTimeout="-1" connector-ref="Database"
doc:name="Database">
<jdbc-ee:query key="select" value="select * from mytable1"/>
</jdbc-ee:outbound-endpoint>
<expression-component doc:name="Expression"><![CDATA[
sessionVars['DB_STATUS']='SUCCESS';
]]></expression-component>
<logger message="--success" level="INFO" doc:name="Logger"/>
</flow>
</mule>
Execution:
URL to trigger the service from browser
http://localhost:8080/US
Database component connects to the specific database, executes
the select query but there is no table specified in DB, hence the
until successful component retries for 5 times and exit the flow.
References
• https://docs.mulesoft.com/mule-user-
guide/v/3.5/until-successful-scope

More Related Content

What's hot

Expression filter in Mule
Expression filter in MuleExpression filter in Mule
Expression filter in Mule
Mohammed246
 
Deploy apps in standalone with maven
Deploy apps in standalone with mavenDeploy apps in standalone with maven
Deploy apps in standalone with maven
Anirban Sen Chowdhary
 
Simple VM in Mule
Simple VM in MuleSimple VM in Mule
Simple VM in Mule
Christian Hipolito
 
Filtering jms messages with mule
Filtering jms messages with muleFiltering jms messages with mule
Filtering jms messages with mule
Anirban Sen Chowdhary
 
Soap in mule
Soap in muleSoap in mule
Soap in mule
D.Rajesh Kumar
 
Mule soap
Mule soapMule soap
Mule soap
Khasim Saheb
 
Using spring scheduler mule
Using spring scheduler muleUsing spring scheduler mule
Using spring scheduler mule
Son Nguyen
 
Scatter and gather in mule
Scatter and gather in muleScatter and gather in mule
Scatter and gather in mule
Rajkattamuri
 
Mule soap
Mule soapMule soap
Mule soap
D.Rajesh Kumar
 
Message properties component in mule demo
Message properties component in mule demoMessage properties component in mule demo
Message properties component in mule demo
Sudha Ch
 
Filter expression in mule
Filter expression in muleFilter expression in mule
Filter expression in mule
Rajkattamuri
 
Creating dynamic json in Mule
Creating dynamic json in MuleCreating dynamic json in Mule
Creating dynamic json in Mule
F K
 
Quartz in Mule
Quartz in MuleQuartz in Mule
Quartz in Mule
Mohammed246
 
Scatter gather in mule
Scatter gather in muleScatter gather in mule
Scatter gather in mule
Khasim Cise
 
Stored procedure in Mule
Stored procedure in MuleStored procedure in Mule
Stored procedure in Mule
Khasim Saheb
 
Message properties component in mule
Message properties component in muleMessage properties component in mule
Message properties component in mule
Khan625
 
Vm component in mule
Vm component in muleVm component in mule
Vm component in mule
javeed_mhd
 
Web service vm in mule
Web service vm in muleWeb service vm in mule
Web service vm in mule
Mohammed246
 

What's hot (18)

Expression filter in Mule
Expression filter in MuleExpression filter in Mule
Expression filter in Mule
 
Deploy apps in standalone with maven
Deploy apps in standalone with mavenDeploy apps in standalone with maven
Deploy apps in standalone with maven
 
Simple VM in Mule
Simple VM in MuleSimple VM in Mule
Simple VM in Mule
 
Filtering jms messages with mule
Filtering jms messages with muleFiltering jms messages with mule
Filtering jms messages with mule
 
Soap in mule
Soap in muleSoap in mule
Soap in mule
 
Mule soap
Mule soapMule soap
Mule soap
 
Using spring scheduler mule
Using spring scheduler muleUsing spring scheduler mule
Using spring scheduler mule
 
Scatter and gather in mule
Scatter and gather in muleScatter and gather in mule
Scatter and gather in mule
 
Mule soap
Mule soapMule soap
Mule soap
 
Message properties component in mule demo
Message properties component in mule demoMessage properties component in mule demo
Message properties component in mule demo
 
Filter expression in mule
Filter expression in muleFilter expression in mule
Filter expression in mule
 
Creating dynamic json in Mule
Creating dynamic json in MuleCreating dynamic json in Mule
Creating dynamic json in Mule
 
Quartz in Mule
Quartz in MuleQuartz in Mule
Quartz in Mule
 
Scatter gather in mule
Scatter gather in muleScatter gather in mule
Scatter gather in mule
 
Stored procedure in Mule
Stored procedure in MuleStored procedure in Mule
Stored procedure in Mule
 
Message properties component in mule
Message properties component in muleMessage properties component in mule
Message properties component in mule
 
Vm component in mule
Vm component in muleVm component in mule
Vm component in mule
 
Web service vm in mule
Web service vm in muleWeb service vm in mule
Web service vm in mule
 

Similar to Basic example using until successful component

Until successful component in mule demo
Until successful component in mule demoUntil successful component in mule demo
Until successful component in mule demo
Sudha Ch
 
Until successful component in mule
Until successful component in muleUntil successful component in mule
Until successful component in mule
javeed_mhd
 
Until successful component
Until successful component Until successful component
Until successful component
Sunil Komarapu
 
Until successful component in mule
Until successful component in muleUntil successful component in mule
Until successful component in mule
F K
 
Until Successful Component
Until Successful ComponentUntil Successful Component
Until Successful Component
Durga Prasad Kakarla
 
How to use until successful component
How to use until successful componentHow to use until successful component
How to use until successful component
maheshtheapex
 
Basic example using for each component
Basic example using for each componentBasic example using for each component
Basic example using for each component
prudhvivreddy
 
Splitter
SplitterSplitter
Choice component
Choice componentChoice component
Choice component
Durga Prasad Kakarla
 
How to use processor chain
How to use processor chainHow to use processor chain
How to use processor chain
sivachandra mandalapu
 
How to use splitter component
How to use splitter componentHow to use splitter component
How to use splitter component
sivachandra mandalapu
 
How to use splitter component
How to use splitter componentHow to use splitter component
How to use splitter component
RaviRajuRamaKrishna
 
Howtouseforeachcomponent
HowtouseforeachcomponentHowtouseforeachcomponent
Howtouseforeachcomponent
akshay yeluru
 
MuleSoft ESB XML to CSV
MuleSoft ESB XML to CSVMuleSoft ESB XML to CSV
MuleSoft ESB XML to CSV
akashdprajapati
 
Choice component in mule demo
Choice component in mule demoChoice component in mule demo
Choice component in mule demo
Sudha Ch
 
MuleSoft ESB CSV to XML
MuleSoft ESB CSV to XMLMuleSoft ESB CSV to XML
MuleSoft ESB CSV to XML
akashdprajapati
 
Wildcard Filter
Wildcard FilterWildcard Filter
Wildcard Filter
sivachandra mandalapu
 
Basic example using choice component
Basic example using choice componentBasic example using choice component
Basic example using choice component
prudhvivreddy
 
Vm Component
Vm ComponentVm Component
Vm Component
Durga Prasad Kakarla
 
Vm component in mule demo
Vm component in mule demoVm component in mule demo
Vm component in mule demo
Sudha Ch
 

Similar to Basic example using until successful component (20)

Until successful component in mule demo
Until successful component in mule demoUntil successful component in mule demo
Until successful component in mule demo
 
Until successful component in mule
Until successful component in muleUntil successful component in mule
Until successful component in mule
 
Until successful component
Until successful component Until successful component
Until successful component
 
Until successful component in mule
Until successful component in muleUntil successful component in mule
Until successful component in mule
 
Until Successful Component
Until Successful ComponentUntil Successful Component
Until Successful Component
 
How to use until successful component
How to use until successful componentHow to use until successful component
How to use until successful component
 
Basic example using for each component
Basic example using for each componentBasic example using for each component
Basic example using for each component
 
Splitter
SplitterSplitter
Splitter
 
Choice component
Choice componentChoice component
Choice component
 
How to use processor chain
How to use processor chainHow to use processor chain
How to use processor chain
 
How to use splitter component
How to use splitter componentHow to use splitter component
How to use splitter component
 
How to use splitter component
How to use splitter componentHow to use splitter component
How to use splitter component
 
Howtouseforeachcomponent
HowtouseforeachcomponentHowtouseforeachcomponent
Howtouseforeachcomponent
 
MuleSoft ESB XML to CSV
MuleSoft ESB XML to CSVMuleSoft ESB XML to CSV
MuleSoft ESB XML to CSV
 
Choice component in mule demo
Choice component in mule demoChoice component in mule demo
Choice component in mule demo
 
MuleSoft ESB CSV to XML
MuleSoft ESB CSV to XMLMuleSoft ESB CSV to XML
MuleSoft ESB CSV to XML
 
Wildcard Filter
Wildcard FilterWildcard Filter
Wildcard Filter
 
Basic example using choice component
Basic example using choice componentBasic example using choice component
Basic example using choice component
 
Vm Component
Vm ComponentVm Component
Vm Component
 
Vm component in mule demo
Vm component in mule demoVm component in mule demo
Vm component in mule demo
 

More from prudhvivreddy

About Mule execution units
About Mule execution unitsAbout Mule execution units
About Mule execution units
prudhvivreddy
 
Working with components
Working with componentsWorking with components
Working with components
prudhvivreddy
 
About mule transformers
About mule transformersAbout mule transformers
About mule transformers
prudhvivreddy
 
About jms
About jmsAbout jms
About jms
prudhvivreddy
 
Webservices
WebservicesWebservices
Webservices
prudhvivreddy
 
Generating the mule flow as html document
Generating the mule flow as html documentGenerating the mule flow as html document
Generating the mule flow as html document
prudhvivreddy
 
Sftp connector
Sftp connectorSftp connector
Sftp connector
prudhvivreddy
 
Imap connector
Imap connectorImap connector
Imap connector
prudhvivreddy
 
Ftp connector
Ftp connectorFtp connector
Ftp connector
prudhvivreddy
 
Hdfs connector
Hdfs connectorHdfs connector
Hdfs connector
prudhvivreddy
 
Ajax connector
Ajax connectorAjax connector
Ajax connector
prudhvivreddy
 
Basic example using database component
Basic example using database componentBasic example using database component
Basic example using database component
prudhvivreddy
 
Basic example using file connector in anypoint studio
Basic example using file connector in anypoint studioBasic example using file connector in anypoint studio
Basic example using file connector in anypoint studio
prudhvivreddy
 
Basic example using quartz component in anypoint studio
Basic example using quartz component in anypoint studioBasic example using quartz component in anypoint studio
Basic example using quartz component in anypoint studio
prudhvivreddy
 
Mule fundamentals
Mule fundamentalsMule fundamentals
Mule fundamentals
prudhvivreddy
 
Salesforce connector Example
Salesforce connector ExampleSalesforce connector Example
Salesforce connector Example
prudhvivreddy
 
Munit junit test case
Munit junit test caseMunit junit test case
Munit junit test case
prudhvivreddy
 

More from prudhvivreddy (17)

About Mule execution units
About Mule execution unitsAbout Mule execution units
About Mule execution units
 
Working with components
Working with componentsWorking with components
Working with components
 
About mule transformers
About mule transformersAbout mule transformers
About mule transformers
 
About jms
About jmsAbout jms
About jms
 
Webservices
WebservicesWebservices
Webservices
 
Generating the mule flow as html document
Generating the mule flow as html documentGenerating the mule flow as html document
Generating the mule flow as html document
 
Sftp connector
Sftp connectorSftp connector
Sftp connector
 
Imap connector
Imap connectorImap connector
Imap connector
 
Ftp connector
Ftp connectorFtp connector
Ftp connector
 
Hdfs connector
Hdfs connectorHdfs connector
Hdfs connector
 
Ajax connector
Ajax connectorAjax connector
Ajax connector
 
Basic example using database component
Basic example using database componentBasic example using database component
Basic example using database component
 
Basic example using file connector in anypoint studio
Basic example using file connector in anypoint studioBasic example using file connector in anypoint studio
Basic example using file connector in anypoint studio
 
Basic example using quartz component in anypoint studio
Basic example using quartz component in anypoint studioBasic example using quartz component in anypoint studio
Basic example using quartz component in anypoint studio
 
Mule fundamentals
Mule fundamentalsMule fundamentals
Mule fundamentals
 
Salesforce connector Example
Salesforce connector ExampleSalesforce connector Example
Salesforce connector Example
 
Munit junit test case
Munit junit test caseMunit junit test case
Munit junit test case
 

Recently uploaded

Community pharmacy- Social and preventive pharmacy UNIT 5
Community pharmacy- Social and preventive pharmacy UNIT 5Community pharmacy- Social and preventive pharmacy UNIT 5
Community pharmacy- Social and preventive pharmacy UNIT 5
sayalidalavi006
 
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
PECB
 
Life upper-Intermediate B2 Workbook for student
Life upper-Intermediate B2 Workbook for studentLife upper-Intermediate B2 Workbook for student
Life upper-Intermediate B2 Workbook for student
NgcHiNguyn25
 
A Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdfA Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdf
Jean Carlos Nunes Paixão
 
DRUGS AND ITS classification slide share
DRUGS AND ITS classification slide shareDRUGS AND ITS classification slide share
DRUGS AND ITS classification slide share
taiba qazi
 
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Dr. Vinod Kumar Kanvaria
 
The History of Stoke Newington Street Names
The History of Stoke Newington Street NamesThe History of Stoke Newington Street Names
The History of Stoke Newington Street Names
History of Stoke Newington
 
MARY JANE WILSON, A “BOA MÃE” .
MARY JANE WILSON, A “BOA MÃE”           .MARY JANE WILSON, A “BOA MÃE”           .
MARY JANE WILSON, A “BOA MÃE” .
Colégio Santa Teresinha
 
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdfANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
Priyankaranawat4
 
PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.
Dr. Shivangi Singh Parihar
 
PIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf IslamabadPIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf Islamabad
AyyanKhan40
 
South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)
Academy of Science of South Africa
 
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
IreneSebastianRueco1
 
S1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptxS1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptx
tarandeep35
 
Digital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments UnitDigital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments Unit
chanes7
 
Pengantar Penggunaan Flutter - Dart programming language1.pptx
Pengantar Penggunaan Flutter - Dart programming language1.pptxPengantar Penggunaan Flutter - Dart programming language1.pptx
Pengantar Penggunaan Flutter - Dart programming language1.pptx
Fajar Baskoro
 
Hindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdfHindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdf
Dr. Mulla Adam Ali
 
How to Setup Warehouse & Location in Odoo 17 Inventory
How to Setup Warehouse & Location in Odoo 17 InventoryHow to Setup Warehouse & Location in Odoo 17 Inventory
How to Setup Warehouse & Location in Odoo 17 Inventory
Celine George
 
How to Add Chatter in the odoo 17 ERP Module
How to Add Chatter in the odoo 17 ERP ModuleHow to Add Chatter in the odoo 17 ERP Module
How to Add Chatter in the odoo 17 ERP Module
Celine George
 
The simplified electron and muon model, Oscillating Spacetime: The Foundation...
The simplified electron and muon model, Oscillating Spacetime: The Foundation...The simplified electron and muon model, Oscillating Spacetime: The Foundation...
The simplified electron and muon model, Oscillating Spacetime: The Foundation...
RitikBhardwaj56
 

Recently uploaded (20)

Community pharmacy- Social and preventive pharmacy UNIT 5
Community pharmacy- Social and preventive pharmacy UNIT 5Community pharmacy- Social and preventive pharmacy UNIT 5
Community pharmacy- Social and preventive pharmacy UNIT 5
 
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
 
Life upper-Intermediate B2 Workbook for student
Life upper-Intermediate B2 Workbook for studentLife upper-Intermediate B2 Workbook for student
Life upper-Intermediate B2 Workbook for student
 
A Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdfA Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdf
 
DRUGS AND ITS classification slide share
DRUGS AND ITS classification slide shareDRUGS AND ITS classification slide share
DRUGS AND ITS classification slide share
 
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
 
The History of Stoke Newington Street Names
The History of Stoke Newington Street NamesThe History of Stoke Newington Street Names
The History of Stoke Newington Street Names
 
MARY JANE WILSON, A “BOA MÃE” .
MARY JANE WILSON, A “BOA MÃE”           .MARY JANE WILSON, A “BOA MÃE”           .
MARY JANE WILSON, A “BOA MÃE” .
 
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdfANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
 
PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.
 
PIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf IslamabadPIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf Islamabad
 
South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)
 
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
 
S1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptxS1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptx
 
Digital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments UnitDigital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments Unit
 
Pengantar Penggunaan Flutter - Dart programming language1.pptx
Pengantar Penggunaan Flutter - Dart programming language1.pptxPengantar Penggunaan Flutter - Dart programming language1.pptx
Pengantar Penggunaan Flutter - Dart programming language1.pptx
 
Hindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdfHindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdf
 
How to Setup Warehouse & Location in Odoo 17 Inventory
How to Setup Warehouse & Location in Odoo 17 InventoryHow to Setup Warehouse & Location in Odoo 17 Inventory
How to Setup Warehouse & Location in Odoo 17 Inventory
 
How to Add Chatter in the odoo 17 ERP Module
How to Add Chatter in the odoo 17 ERP ModuleHow to Add Chatter in the odoo 17 ERP Module
How to Add Chatter in the odoo 17 ERP Module
 
The simplified electron and muon model, Oscillating Spacetime: The Foundation...
The simplified electron and muon model, Oscillating Spacetime: The Foundation...The simplified electron and muon model, Oscillating Spacetime: The Foundation...
The simplified electron and muon model, Oscillating Spacetime: The Foundation...
 

Basic example using until successful component

  • 1. Basic Example Using Until Successful Component
  • 2. Introduction The until-successful scope processes messages through the processors within it until the process succeeds. By default, until-successful’s processing occurs asynchronously from the main flow. After passing a message into the until-successful scope, the main flow immediately regains control of the thread. However, you can configure until-successful to run synchronously relative to the main flow.
  • 4. XML: <?xml version="1.0" encoding="UTF-8"?><mule xmlns:vm="http://www.mulesoft.org/schema/mule/vm" xmlns:jdbc- ee="http://www.mulesoft.org/schema/mule/ee/jdbc" 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" version="EE-3.4.0" 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://www.mulesoft.org/schema/mule/ee/jdbc http://www.mulesoft.org/schema/mule/ee/jdbc/current/mule-jdbc-ee.xsd http://www.mulesoft.org/schema/mule/vm http://www.mulesoft.org/schema/mule/vm/current/mule-vm.xsd"> <jdbc-ee:mssql-data-source name="MS_SQL_Data_Source" user=“****" password=“****" url="jdbc:sqlserver://localhost;databaseName=test1" transactionIsolation="UNSPECIFIED" doc:name="MS SQL Data Source"/> <jdbc-ee:connector name="Database" dataSource-ref="MS_SQL_Data_Source" validateConnections="true" queryTimeout="-1" pollingFrequency="0" doc:name="Database"/> <spring:beans> <spring:bean id="Bean" name="Bean" class="org.mule.util.store.SimpleMemoryObjectStore"/> </spring:beans> <flow name="Database_ComponentFlow2" doc:name="Database_ComponentFlow2"> <http:inbound-endpoint exchange-pattern="request-response" host="localhost" port="8080" path="US" doc:name="HTTP"/> <logger message="--main flow--" level="INFO" doc:name="Logger"/> <expression-component doc:name="Expression"><![CDATA[ sessionVars['DB_STATUS']='INITIAL'; ]]></expression-component> <until-successful objectStore-ref="Bean" maxRetries="5" secondsBetweenRetries="5" doc:name="Until Successful" failureExpression="#[sessionVars['DB_STATUS']!='SUCCESS']"> <vm:outbound-endpoint exchange-pattern="request-response" path="db" doc:name="VM"/> </until-successful> </flow> <flow name="Database_ComponentFlow3" doc:name="Database_ComponentFlow3"> <vm:inbound-endpoint exchange-pattern="request-response" path="db" doc:name="VM"/> <jdbc-ee:outbound-endpoint exchange-pattern="request-response" queryKey="select" queryTimeout="-1" connector-ref="Database" doc:name="Database"> <jdbc-ee:query key="select" value="select * from mytable1"/> </jdbc-ee:outbound-endpoint> <expression-component doc:name="Expression"><![CDATA[ sessionVars['DB_STATUS']='SUCCESS'; ]]></expression-component> <logger message="--success" level="INFO" doc:name="Logger"/> </flow> </mule>
  • 5. Execution: URL to trigger the service from browser http://localhost:8080/US Database component connects to the specific database, executes the select query but there is no table specified in DB, hence the until successful component retries for 5 times and exit the flow.