SlideShare a Scribd company logo
1 of 14
 Components can use bindings to call an external
service during execution.
 The bindings used with a Java component bind a
Java interface, or single interface method, to an
outbound endpoint.
 The external service to be called should implement
the same interface, and the component should
encapsulate a reference to that interface, which is
initialized during the bootstrap stage by the Mule
configuration builder.
 The reference will be initialized using a reflective
proxy class.
 With component bindings, you can configure
multiple interfaces or a single interface with
an endpoint bound to one or more Mule
endpoints.
 Mule currently supports component bindings
for Java components (the default
components in Mule) and script components,
such as Groovy or JRuby. This page
describes how to configure each.
 Bindings can be used by components to call out to an
external service.
 The bound interface is added to the component as a field
with the usual bean getter and setter methods. In the
binding configuration for the component, you can bind this
interface along with a method in the interface to a Mule
endpoint.
 When that method is called, the call parameters are sent
over the Mule endpoint to another service, which may be
local or remote. A result may be returned from the flow and
passed back to the component using the return argument
of the method. This model is very similar to traditional RPC
calls.
 In the above example, the
component InvokerComponent has a field hello,
which is of typeHelloInterface, with getter and
setter methods for the field. The invoke method
will be called on the flow and calls
the hello.sayHello() method. This call will result
in another flow.
 The HelloInterface is very simple with a single
method sayHello.
 You can handle data conversion when making a
call and receiving a result using the normal
transformer configuration on the endpoint. In
the above example, assume the Web service
was expecting
an org.mule.examples.bindings.WebHelloRequ
est object and returned
an org.mule.examples.bindings.WebHelloResp
onse object. You don’t want your component to
know about these external data types, so you
can configure transformers to do the conversion
when the call is made as shown in next slide :
 If the remote flow triggers an exception of
fault, this exception will get serialized back to
the local flow call and thrown.
 If your service wants to handle this
exception, you must add the exception
(or java.lang.Exception) to the bound method
signature and use a try catch block as usual.
 The implementation for the component is
contained within the <script:script>element
as shown below :
 return "Total: " +
AdditionService.add(1,2)
ThankYou!!!!!!!!

More Related Content

What's hot

Implementing an Esb using Mule
Implementing an Esb using MuleImplementing an Esb using Mule
Implementing an Esb using MuleAbdulImrankhan7
 
Mule - beginners guide
Mule - beginners guideMule - beginners guide
Mule - beginners guideSindhu VL
 
Using mule configuration patterns
Using mule configuration patternsUsing mule configuration patterns
Using mule configuration patternsSindhu VL
 
Web service vm in mule
Web service vm in muleWeb service vm in mule
Web service vm in muleMohammed246
 
Create Account in Salesforce using Mule ESB
Create Account in Salesforce using Mule ESBCreate Account in Salesforce using Mule ESB
Create Account in Salesforce using Mule ESBSanjeet Pandey
 
Using mule with web services
Using mule with web servicesUsing mule with web services
Using mule with web servicesShanky Gupta
 
Implementing an ESB using Mule
Implementing an ESB using MuleImplementing an ESB using Mule
Implementing an ESB using Muleelliando dias
 
A Short Introduction of Mule ESB
A Short Introduction of Mule ESBA Short Introduction of Mule ESB
A Short Introduction of Mule ESBSwapnil Sahu
 
ESB introduction using Mule
ESB introduction using MuleESB introduction using Mule
ESB introduction using MuleKhasim Cise
 

What's hot (18)

Mule real-world-old
Mule real-world-oldMule real-world-old
Mule real-world-old
 
Implementing an Esb using Mule
Implementing an Esb using MuleImplementing an Esb using Mule
Implementing an Esb using Mule
 
Mule - beginners guide
Mule - beginners guideMule - beginners guide
Mule - beginners guide
 
Webservice vm in mule
Webservice vm in muleWebservice vm in mule
Webservice vm in mule
 
Making flow Mule
Making flow MuleMaking flow Mule
Making flow Mule
 
Using mule configuration patterns
Using mule configuration patternsUsing mule configuration patterns
Using mule configuration patterns
 
How muleworks
How muleworksHow muleworks
How muleworks
 
Mule execution
Mule executionMule execution
Mule execution
 
mule real world
mule real worldmule real world
mule real world
 
Web service vm in mule
Web service vm in muleWeb service vm in mule
Web service vm in mule
 
Mule esb
Mule esbMule esb
Mule esb
 
Create Account in Salesforce using Mule ESB
Create Account in Salesforce using Mule ESBCreate Account in Salesforce using Mule ESB
Create Account in Salesforce using Mule ESB
 
Using mule with web services
Using mule with web servicesUsing mule with web services
Using mule with web services
 
VM example in mule
VM example in muleVM example in mule
VM example in mule
 
Implementing an ESB using Mule
Implementing an ESB using MuleImplementing an ESB using Mule
Implementing an ESB using Mule
 
A Short Introduction of Mule ESB
A Short Introduction of Mule ESBA Short Introduction of Mule ESB
A Short Introduction of Mule ESB
 
ESB introduction using Mule
ESB introduction using MuleESB introduction using Mule
ESB introduction using Mule
 
Mule execution
Mule executionMule execution
Mule execution
 

Viewers also liked

File types pro forma(1)
File types pro forma(1)File types pro forma(1)
File types pro forma(1)Joe Young
 
3.38 curta com amor iguatemi brasília
3.38 curta com amor   iguatemi brasília3.38 curta com amor   iguatemi brasília
3.38 curta com amor iguatemi brasíliaMoringa
 
Kluwer
KluwerKluwer
Kluweringron
 
Mule database-connectors
Mule database-connectorsMule database-connectors
Mule database-connectorsAnand kalla
 
Quartz in mule
Quartz in muleQuartz in mule
Quartz in muleSon Nguyen
 
Mule: Munit domain support
Mule: Munit domain supportMule: Munit domain support
Mule: Munit domain supportShanky Gupta
 
Mule esb How to use Collection Splitter in 5 minutes
Mule esb How to use Collection Splitter in 5 minutesMule esb How to use Collection Splitter in 5 minutes
Mule esb How to use Collection Splitter in 5 minutesGennaro Spagnoli
 
Document in mule application
Document in mule applicationDocument in mule application
Document in mule applicationSon Nguyen
 
Mule esb basics beginners
Mule esb basics beginnersMule esb basics beginners
Mule esb basics beginnersveena naresh
 
Mocking with salesforce using Munit
Mocking with salesforce using MunitMocking with salesforce using Munit
Mocking with salesforce using MunitSon Nguyen
 
Unit testing using Munit Part 1
Unit testing using Munit Part 1Unit testing using Munit Part 1
Unit testing using Munit Part 1Anand kalla
 
ENTREGABILIDADE, QUE PALAVRÃO! DICAS SIMPLES PARA ENTREGAR MAIS E MELHOR
ENTREGABILIDADE, QUE PALAVRÃO! DICAS SIMPLES PARA ENTREGAR MAIS E MELHORENTREGABILIDADE, QUE PALAVRÃO! DICAS SIMPLES PARA ENTREGAR MAIS E MELHOR
ENTREGABILIDADE, QUE PALAVRÃO! DICAS SIMPLES PARA ENTREGAR MAIS E MELHORMedia Education
 
Mule legacy modernization example
Mule legacy modernization exampleMule legacy modernization example
Mule legacy modernization exampleD.Rajesh Kumar
 

Viewers also liked (19)

File types pro forma(1)
File types pro forma(1)File types pro forma(1)
File types pro forma(1)
 
Mule soa
Mule soaMule soa
Mule soa
 
3.38 curta com amor iguatemi brasília
3.38 curta com amor   iguatemi brasília3.38 curta com amor   iguatemi brasília
3.38 curta com amor iguatemi brasília
 
Abstract Book92-9-12
Abstract Book92-9-12Abstract Book92-9-12
Abstract Book92-9-12
 
Kluwer
KluwerKluwer
Kluwer
 
Mule database-connectors
Mule database-connectorsMule database-connectors
Mule database-connectors
 
Quartz in mule
Quartz in muleQuartz in mule
Quartz in mule
 
Mule: Munit domain support
Mule: Munit domain supportMule: Munit domain support
Mule: Munit domain support
 
Overview of MUnit
Overview of MUnitOverview of MUnit
Overview of MUnit
 
Mule esb How to use Collection Splitter in 5 minutes
Mule esb How to use Collection Splitter in 5 minutesMule esb How to use Collection Splitter in 5 minutes
Mule esb How to use Collection Splitter in 5 minutes
 
Document in mule application
Document in mule applicationDocument in mule application
Document in mule application
 
Mule esb munit
Mule esb munitMule esb munit
Mule esb munit
 
Mule esb basics beginners
Mule esb basics beginnersMule esb basics beginners
Mule esb basics beginners
 
Mule esb basics
Mule esb basicsMule esb basics
Mule esb basics
 
Mocking with salesforce using Munit
Mocking with salesforce using MunitMocking with salesforce using Munit
Mocking with salesforce using Munit
 
Java in Mule
Java in MuleJava in Mule
Java in Mule
 
Unit testing using Munit Part 1
Unit testing using Munit Part 1Unit testing using Munit Part 1
Unit testing using Munit Part 1
 
ENTREGABILIDADE, QUE PALAVRÃO! DICAS SIMPLES PARA ENTREGAR MAIS E MELHOR
ENTREGABILIDADE, QUE PALAVRÃO! DICAS SIMPLES PARA ENTREGAR MAIS E MELHORENTREGABILIDADE, QUE PALAVRÃO! DICAS SIMPLES PARA ENTREGAR MAIS E MELHOR
ENTREGABILIDADE, QUE PALAVRÃO! DICAS SIMPLES PARA ENTREGAR MAIS E MELHOR
 
Mule legacy modernization example
Mule legacy modernization exampleMule legacy modernization example
Mule legacy modernization example
 

Similar to Bindings of components in mule

DUTDIP - Don't Use This Dependency Injection
DUTDIP - Don't Use This Dependency InjectionDUTDIP - Don't Use This Dependency Injection
DUTDIP - Don't Use This Dependency InjectionRushabh Dadbhawala
 
Webservices in SalesForce (part 1)
Webservices in SalesForce (part 1)Webservices in SalesForce (part 1)
Webservices in SalesForce (part 1)Mindfire Solutions
 
ASP.Net MVC 4 [Part - 2]
ASP.Net MVC 4 [Part - 2]ASP.Net MVC 4 [Part - 2]
ASP.Net MVC 4 [Part - 2]Mohamed Abdeen
 
How To Use IO Monads in Scala?
 How To Use IO Monads in Scala? How To Use IO Monads in Scala?
How To Use IO Monads in Scala?Knoldus Inc.
 
Sun certifiedwebcomponentdeveloperstudyguide
Sun certifiedwebcomponentdeveloperstudyguideSun certifiedwebcomponentdeveloperstudyguide
Sun certifiedwebcomponentdeveloperstudyguideAlberto Romero Jiménez
 
An Introduction To Java Web Technology
An Introduction To Java Web TechnologyAn Introduction To Java Web Technology
An Introduction To Java Web Technologyvikram singh
 
How to ace your .NET technical interview :: .Net Technical Check Tuneup
How to ace your .NET technical interview :: .Net Technical Check TuneupHow to ace your .NET technical interview :: .Net Technical Check Tuneup
How to ace your .NET technical interview :: .Net Technical Check TuneupBala Subra
 
SCWCD : The servlet container : CHAP : 4
SCWCD : The servlet container : CHAP : 4SCWCD : The servlet container : CHAP : 4
SCWCD : The servlet container : CHAP : 4Ben Abdallah Helmi
 
Mule ESB Interview or Certification questions
Mule ESB Interview or Certification questionsMule ESB Interview or Certification questions
Mule ESB Interview or Certification questionsTechieVarsity
 

Similar to Bindings of components in mule (20)

Component library
Component libraryComponent library
Component library
 
DUTDIP - Don't Use This Dependency Injection
DUTDIP - Don't Use This Dependency InjectionDUTDIP - Don't Use This Dependency Injection
DUTDIP - Don't Use This Dependency Injection
 
Java servlets
Java servletsJava servlets
Java servlets
 
J2EE pattern 5
J2EE pattern 5J2EE pattern 5
J2EE pattern 5
 
Webservices in SalesForce (part 1)
Webservices in SalesForce (part 1)Webservices in SalesForce (part 1)
Webservices in SalesForce (part 1)
 
Lecture5
Lecture5Lecture5
Lecture5
 
Express node js
Express node jsExpress node js
Express node js
 
PHP 7
PHP 7PHP 7
PHP 7
 
ASP.Net MVC 4 [Part - 2]
ASP.Net MVC 4 [Part - 2]ASP.Net MVC 4 [Part - 2]
ASP.Net MVC 4 [Part - 2]
 
How To Use IO Monads in Scala?
 How To Use IO Monads in Scala? How To Use IO Monads in Scala?
How To Use IO Monads in Scala?
 
Spring mvc
Spring mvcSpring mvc
Spring mvc
 
Sun certifiedwebcomponentdeveloperstudyguide
Sun certifiedwebcomponentdeveloperstudyguideSun certifiedwebcomponentdeveloperstudyguide
Sun certifiedwebcomponentdeveloperstudyguide
 
An Introduction To Java Web Technology
An Introduction To Java Web TechnologyAn Introduction To Java Web Technology
An Introduction To Java Web Technology
 
Servlet
Servlet Servlet
Servlet
 
Mule ESB
Mule ESBMule ESB
Mule ESB
 
Servlets
ServletsServlets
Servlets
 
How to ace your .NET technical interview :: .Net Technical Check Tuneup
How to ace your .NET technical interview :: .Net Technical Check TuneupHow to ace your .NET technical interview :: .Net Technical Check Tuneup
How to ace your .NET technical interview :: .Net Technical Check Tuneup
 
SCWCD : The servlet container : CHAP : 4
SCWCD : The servlet container : CHAP : 4SCWCD : The servlet container : CHAP : 4
SCWCD : The servlet container : CHAP : 4
 
17612235.ppt
17612235.ppt17612235.ppt
17612235.ppt
 
Mule ESB Interview or Certification questions
Mule ESB Interview or Certification questionsMule ESB Interview or Certification questions
Mule ESB Interview or Certification questions
 

Recently uploaded

poliovirus-190801072449. pptx
poliovirus-190801072449.            pptxpoliovirus-190801072449.            pptx
poliovirus-190801072449. pptxssuser0ad194
 
一比一原版(WLU毕业证)罗瑞尔大学毕业证成绩单留信学历认证原版一模一样
一比一原版(WLU毕业证)罗瑞尔大学毕业证成绩单留信学历认证原版一模一样一比一原版(WLU毕业证)罗瑞尔大学毕业证成绩单留信学历认证原版一模一样
一比一原版(WLU毕业证)罗瑞尔大学毕业证成绩单留信学历认证原版一模一样awasv46j
 
怎样办理莫纳什大学毕业证(Monash毕业证书)成绩单留信认证
怎样办理莫纳什大学毕业证(Monash毕业证书)成绩单留信认证怎样办理莫纳什大学毕业证(Monash毕业证书)成绩单留信认证
怎样办理莫纳什大学毕业证(Monash毕业证书)成绩单留信认证ehyxf
 
Raebareli Girl Whatsapp Number 📞 8617370543 | Girls Number for Friendship
Raebareli Girl Whatsapp Number 📞 8617370543 | Girls Number for FriendshipRaebareli Girl Whatsapp Number 📞 8617370543 | Girls Number for Friendship
Raebareli Girl Whatsapp Number 📞 8617370543 | Girls Number for FriendshipNitya salvi
 
Abortion pills in Riyadh +966572737505 <> buy cytotec <> unwanted kit Saudi A...
Abortion pills in Riyadh +966572737505 <> buy cytotec <> unwanted kit Saudi A...Abortion pills in Riyadh +966572737505 <> buy cytotec <> unwanted kit Saudi A...
Abortion pills in Riyadh +966572737505 <> buy cytotec <> unwanted kit Saudi A...samsungultra782445
 
How to Build a Simple Shopify Website
How to Build a Simple Shopify WebsiteHow to Build a Simple Shopify Website
How to Build a Simple Shopify Websitemark11275
 
怎样办理巴斯大学毕业证(Bath毕业证书)成绩单留信认证
怎样办理巴斯大学毕业证(Bath毕业证书)成绩单留信认证怎样办理巴斯大学毕业证(Bath毕业证书)成绩单留信认证
怎样办理巴斯大学毕业证(Bath毕业证书)成绩单留信认证eeanqy
 
Just Call Vip call girls Fatehpur Escorts ☎️8617370543 Two shot with one girl...
Just Call Vip call girls Fatehpur Escorts ☎️8617370543 Two shot with one girl...Just Call Vip call girls Fatehpur Escorts ☎️8617370543 Two shot with one girl...
Just Call Vip call girls Fatehpur Escorts ☎️8617370543 Two shot with one girl...Nitya salvi
 
一比一原版(ANU毕业证书)澳大利亚国立大学毕业证原件一模一样
一比一原版(ANU毕业证书)澳大利亚国立大学毕业证原件一模一样一比一原版(ANU毕业证书)澳大利亚国立大学毕业证原件一模一样
一比一原版(ANU毕业证书)澳大利亚国立大学毕业证原件一模一样yhavx
 
Just Call Vip call girls Kasganj Escorts ☎️8617370543 Two shot with one girl ...
Just Call Vip call girls Kasganj Escorts ☎️8617370543 Two shot with one girl ...Just Call Vip call girls Kasganj Escorts ☎️8617370543 Two shot with one girl ...
Just Call Vip call girls Kasganj Escorts ☎️8617370543 Two shot with one girl ...Nitya salvi
 
TRose UXPA Experience Design Concord .pptx
TRose UXPA Experience Design Concord .pptxTRose UXPA Experience Design Concord .pptx
TRose UXPA Experience Design Concord .pptxtrose8
 
Gamestore case study UI UX by Amgad Ibrahim
Gamestore case study UI UX by Amgad IbrahimGamestore case study UI UX by Amgad Ibrahim
Gamestore case study UI UX by Amgad Ibrahimamgadibrahim92
 
Simple Conference Style Presentation by Slidesgo.pptx
Simple Conference Style Presentation by Slidesgo.pptxSimple Conference Style Presentation by Slidesgo.pptx
Simple Conference Style Presentation by Slidesgo.pptxbalqisyamutia
 
BLOCK CHAIN PROJECT block chain project
BLOCK CHAIN  PROJECT block chain projectBLOCK CHAIN  PROJECT block chain project
BLOCK CHAIN PROJECT block chain projectujraj8767
 
Top profile Call Girls In Mysore [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Mysore [ 7014168258 ] Call Me For Genuine Models We...Top profile Call Girls In Mysore [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Mysore [ 7014168258 ] Call Me For Genuine Models We...gajnagarg
 
Jordan_Amanda_DMBS202404_PB1_2024-04.pdf
Jordan_Amanda_DMBS202404_PB1_2024-04.pdfJordan_Amanda_DMBS202404_PB1_2024-04.pdf
Jordan_Amanda_DMBS202404_PB1_2024-04.pdfamanda2495
 
The hottest UI and UX Design Trends 2024
The hottest UI and UX Design Trends 2024The hottest UI and UX Design Trends 2024
The hottest UI and UX Design Trends 2024Ilham Brata
 
Pondicherry Escorts Service Girl ^ 9332606886, WhatsApp Anytime Pondicherry
Pondicherry Escorts Service Girl ^ 9332606886, WhatsApp Anytime PondicherryPondicherry Escorts Service Girl ^ 9332606886, WhatsApp Anytime Pondicherry
Pondicherry Escorts Service Girl ^ 9332606886, WhatsApp Anytime Pondicherrymeghakumariji156
 
ab-initio-training basics and architecture
ab-initio-training basics and architectureab-initio-training basics and architecture
ab-initio-training basics and architecturesaipriyacoool
 

Recently uploaded (20)

Abortion Pills in Oman (+918133066128) Cytotec clinic buy Oman Muscat
Abortion Pills in Oman (+918133066128) Cytotec clinic buy Oman MuscatAbortion Pills in Oman (+918133066128) Cytotec clinic buy Oman Muscat
Abortion Pills in Oman (+918133066128) Cytotec clinic buy Oman Muscat
 
poliovirus-190801072449. pptx
poliovirus-190801072449.            pptxpoliovirus-190801072449.            pptx
poliovirus-190801072449. pptx
 
一比一原版(WLU毕业证)罗瑞尔大学毕业证成绩单留信学历认证原版一模一样
一比一原版(WLU毕业证)罗瑞尔大学毕业证成绩单留信学历认证原版一模一样一比一原版(WLU毕业证)罗瑞尔大学毕业证成绩单留信学历认证原版一模一样
一比一原版(WLU毕业证)罗瑞尔大学毕业证成绩单留信学历认证原版一模一样
 
怎样办理莫纳什大学毕业证(Monash毕业证书)成绩单留信认证
怎样办理莫纳什大学毕业证(Monash毕业证书)成绩单留信认证怎样办理莫纳什大学毕业证(Monash毕业证书)成绩单留信认证
怎样办理莫纳什大学毕业证(Monash毕业证书)成绩单留信认证
 
Raebareli Girl Whatsapp Number 📞 8617370543 | Girls Number for Friendship
Raebareli Girl Whatsapp Number 📞 8617370543 | Girls Number for FriendshipRaebareli Girl Whatsapp Number 📞 8617370543 | Girls Number for Friendship
Raebareli Girl Whatsapp Number 📞 8617370543 | Girls Number for Friendship
 
Abortion pills in Riyadh +966572737505 <> buy cytotec <> unwanted kit Saudi A...
Abortion pills in Riyadh +966572737505 <> buy cytotec <> unwanted kit Saudi A...Abortion pills in Riyadh +966572737505 <> buy cytotec <> unwanted kit Saudi A...
Abortion pills in Riyadh +966572737505 <> buy cytotec <> unwanted kit Saudi A...
 
How to Build a Simple Shopify Website
How to Build a Simple Shopify WebsiteHow to Build a Simple Shopify Website
How to Build a Simple Shopify Website
 
怎样办理巴斯大学毕业证(Bath毕业证书)成绩单留信认证
怎样办理巴斯大学毕业证(Bath毕业证书)成绩单留信认证怎样办理巴斯大学毕业证(Bath毕业证书)成绩单留信认证
怎样办理巴斯大学毕业证(Bath毕业证书)成绩单留信认证
 
Just Call Vip call girls Fatehpur Escorts ☎️8617370543 Two shot with one girl...
Just Call Vip call girls Fatehpur Escorts ☎️8617370543 Two shot with one girl...Just Call Vip call girls Fatehpur Escorts ☎️8617370543 Two shot with one girl...
Just Call Vip call girls Fatehpur Escorts ☎️8617370543 Two shot with one girl...
 
一比一原版(ANU毕业证书)澳大利亚国立大学毕业证原件一模一样
一比一原版(ANU毕业证书)澳大利亚国立大学毕业证原件一模一样一比一原版(ANU毕业证书)澳大利亚国立大学毕业证原件一模一样
一比一原版(ANU毕业证书)澳大利亚国立大学毕业证原件一模一样
 
Just Call Vip call girls Kasganj Escorts ☎️8617370543 Two shot with one girl ...
Just Call Vip call girls Kasganj Escorts ☎️8617370543 Two shot with one girl ...Just Call Vip call girls Kasganj Escorts ☎️8617370543 Two shot with one girl ...
Just Call Vip call girls Kasganj Escorts ☎️8617370543 Two shot with one girl ...
 
TRose UXPA Experience Design Concord .pptx
TRose UXPA Experience Design Concord .pptxTRose UXPA Experience Design Concord .pptx
TRose UXPA Experience Design Concord .pptx
 
Gamestore case study UI UX by Amgad Ibrahim
Gamestore case study UI UX by Amgad IbrahimGamestore case study UI UX by Amgad Ibrahim
Gamestore case study UI UX by Amgad Ibrahim
 
Simple Conference Style Presentation by Slidesgo.pptx
Simple Conference Style Presentation by Slidesgo.pptxSimple Conference Style Presentation by Slidesgo.pptx
Simple Conference Style Presentation by Slidesgo.pptx
 
BLOCK CHAIN PROJECT block chain project
BLOCK CHAIN  PROJECT block chain projectBLOCK CHAIN  PROJECT block chain project
BLOCK CHAIN PROJECT block chain project
 
Top profile Call Girls In Mysore [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Mysore [ 7014168258 ] Call Me For Genuine Models We...Top profile Call Girls In Mysore [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Mysore [ 7014168258 ] Call Me For Genuine Models We...
 
Jordan_Amanda_DMBS202404_PB1_2024-04.pdf
Jordan_Amanda_DMBS202404_PB1_2024-04.pdfJordan_Amanda_DMBS202404_PB1_2024-04.pdf
Jordan_Amanda_DMBS202404_PB1_2024-04.pdf
 
The hottest UI and UX Design Trends 2024
The hottest UI and UX Design Trends 2024The hottest UI and UX Design Trends 2024
The hottest UI and UX Design Trends 2024
 
Pondicherry Escorts Service Girl ^ 9332606886, WhatsApp Anytime Pondicherry
Pondicherry Escorts Service Girl ^ 9332606886, WhatsApp Anytime PondicherryPondicherry Escorts Service Girl ^ 9332606886, WhatsApp Anytime Pondicherry
Pondicherry Escorts Service Girl ^ 9332606886, WhatsApp Anytime Pondicherry
 
ab-initio-training basics and architecture
ab-initio-training basics and architectureab-initio-training basics and architecture
ab-initio-training basics and architecture
 

Bindings of components in mule

  • 1.
  • 2.  Components can use bindings to call an external service during execution.  The bindings used with a Java component bind a Java interface, or single interface method, to an outbound endpoint.  The external service to be called should implement the same interface, and the component should encapsulate a reference to that interface, which is initialized during the bootstrap stage by the Mule configuration builder.  The reference will be initialized using a reflective proxy class.
  • 3.
  • 4.  With component bindings, you can configure multiple interfaces or a single interface with an endpoint bound to one or more Mule endpoints.  Mule currently supports component bindings for Java components (the default components in Mule) and script components, such as Groovy or JRuby. This page describes how to configure each.
  • 5.  Bindings can be used by components to call out to an external service.  The bound interface is added to the component as a field with the usual bean getter and setter methods. In the binding configuration for the component, you can bind this interface along with a method in the interface to a Mule endpoint.  When that method is called, the call parameters are sent over the Mule endpoint to another service, which may be local or remote. A result may be returned from the flow and passed back to the component using the return argument of the method. This model is very similar to traditional RPC calls.
  • 6.
  • 7.  In the above example, the component InvokerComponent has a field hello, which is of typeHelloInterface, with getter and setter methods for the field. The invoke method will be called on the flow and calls the hello.sayHello() method. This call will result in another flow.  The HelloInterface is very simple with a single method sayHello.
  • 8.
  • 9.  You can handle data conversion when making a call and receiving a result using the normal transformer configuration on the endpoint. In the above example, assume the Web service was expecting an org.mule.examples.bindings.WebHelloRequ est object and returned an org.mule.examples.bindings.WebHelloResp onse object. You don’t want your component to know about these external data types, so you can configure transformers to do the conversion when the call is made as shown in next slide :
  • 10.
  • 11.  If the remote flow triggers an exception of fault, this exception will get serialized back to the local flow call and thrown.  If your service wants to handle this exception, you must add the exception (or java.lang.Exception) to the bound method signature and use a try catch block as usual.
  • 12.
  • 13.  The implementation for the component is contained within the <script:script>element as shown below :  return "Total: " + AdditionService.add(1,2)