SlideShare a Scribd company logo
Bindings of components in mule
 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.
Bindings of components in mule
 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.
Bindings of components in mule
 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.
Bindings of components in mule
 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 :
Bindings of components in mule
 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.
Bindings of components in mule
 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

PPTX
MuleSoft Consuming Soap Web Service - CXF Proxy-Client Module
PPT
Mule Fundamentals
PPTX
Mule soa
PPTX
Core concepts - mule
PPTX
SOAP To REST API Proxy
PPT
4. mule real-world-old
PPTX
Configuration patterns in mule
PPTX
Concepts in mule
MuleSoft Consuming Soap Web Service - CXF Proxy-Client Module
Mule Fundamentals
Mule soa
Core concepts - mule
SOAP To REST API Proxy
4. mule real-world-old
Configuration patterns in mule
Concepts in mule

What's hot (18)

PPT
Mule real-world-old
PPT
Implementing an Esb using Mule
PPTX
Mule - beginners guide
PPTX
Webservice vm in mule
PPTX
Making flow Mule
PPTX
Using mule configuration patterns
PPTX
How muleworks
PPT
Mule execution
PPT
mule real world
PPTX
Web service vm in mule
PPTX
Mule esb
PPTX
Create Account in Salesforce using Mule ESB
PPTX
Using mule with web services
PPTX
VM example in mule
PPT
Implementing an ESB using Mule
PPTX
A Short Introduction of Mule ESB
PPT
ESB introduction using Mule
PPT
Mule execution
Mule real-world-old
Implementing an Esb using Mule
Mule - beginners guide
Webservice vm in mule
Making flow Mule
Using mule configuration patterns
How muleworks
Mule execution
mule real world
Web service vm in mule
Mule esb
Create Account in Salesforce using Mule ESB
Using mule with web services
VM example in mule
Implementing an ESB using Mule
A Short Introduction of Mule ESB
ESB introduction using Mule
Mule execution
Ad

Viewers also liked (19)

PPTX
File types pro forma(1)
PPTX
Mule soa
PDF
3.38 curta com amor iguatemi brasília
PDF
Abstract Book92-9-12
PPT
Kluwer
PPT
Mule database-connectors
PPTX
Quartz in mule
PPTX
Mule: Munit domain support
PPTX
Overview of MUnit
PPTX
Mule esb How to use Collection Splitter in 5 minutes
PPTX
Document in mule application
ODP
Mule esb munit
PPTX
Mule esb basics beginners
PPTX
Mule esb basics
PPTX
Mocking with salesforce using Munit
PPTX
Java in Mule
PPTX
Unit testing using Munit Part 1
PDF
ENTREGABILIDADE, QUE PALAVRÃO! DICAS SIMPLES PARA ENTREGAR MAIS E MELHOR
PPT
Mule legacy modernization example
File types pro forma(1)
Mule soa
3.38 curta com amor iguatemi brasília
Abstract Book92-9-12
Kluwer
Mule database-connectors
Quartz in mule
Mule: Munit domain support
Overview of MUnit
Mule esb How to use Collection Splitter in 5 minutes
Document in mule application
Mule esb munit
Mule esb basics beginners
Mule esb basics
Mocking with salesforce using Munit
Java in Mule
Unit testing using Munit Part 1
ENTREGABILIDADE, QUE PALAVRÃO! DICAS SIMPLES PARA ENTREGAR MAIS E MELHOR
Mule legacy modernization example
Ad

Similar to Bindings of components in mule (20)

PDF
Component library
PDF
DUTDIP - Don't Use This Dependency Injection
PPTX
Global Exception Handling Custom Error Connector In MuleSoft
PPTX
Java servlets
PPTX
J2EE pattern 5
PDF
Webservices in SalesForce (part 1)
PDF
Express node js
PPTX
PPTX
ASP.Net MVC 4 [Part - 2]
PDF
How To Use IO Monads in Scala?
PPTX
Spring mvc
PDF
Sun certifiedwebcomponentdeveloperstudyguide
PPT
An Introduction To Java Web Technology
DOCX
Servlet
PDF
Mule ESB
PPTX
PPT
How to ace your .NET technical interview :: .Net Technical Check Tuneup
PPTX
SCWCD : The servlet container : CHAP : 4
PPT
17612235.ppt
Component library
DUTDIP - Don't Use This Dependency Injection
Global Exception Handling Custom Error Connector In MuleSoft
Java servlets
J2EE pattern 5
Webservices in SalesForce (part 1)
Express node js
ASP.Net MVC 4 [Part - 2]
How To Use IO Monads in Scala?
Spring mvc
Sun certifiedwebcomponentdeveloperstudyguide
An Introduction To Java Web Technology
Servlet
Mule ESB
How to ace your .NET technical interview :: .Net Technical Check Tuneup
SCWCD : The servlet container : CHAP : 4
17612235.ppt

Recently uploaded (20)

PPTX
Wisp Textiles: Where Comfort Meets Everyday Style
PDF
The Advantages of Working With a Design-Build Studio
PPTX
Special finishes, classification and types, explanation
PDF
Phone away, tabs closed: No multitasking
PDF
UNIT 1 Introduction fnfbbfhfhfbdhdbdto Java.pptx.pdf
PDF
High-frequency high-voltage transformer outline drawing
PPT
unit 1 ppt.ppthhhhhhhhhhhhhhhhhhhhhhhhhh
PPTX
areprosthodontics and orthodonticsa text.pptx
PPTX
AD Bungalow Case studies Sem 2.pptxvwewev
PPTX
Implications Existing phase plan and its feasibility.pptx
PDF
Design Thinking - Module 1 - Introduction To Design Thinking - Dr. Rohan Dasg...
PPTX
Tenders & Contracts Works _ Services Afzal.pptx
PDF
Integrated-2D-and-3D-Animation-Bridging-Dimensions-for-Impactful-Storytelling...
PPTX
building Planning Overview for step wise design.pptx
PDF
Facade & Landscape Lighting Techniques and Trends.pptx.pdf
PPTX
HPE Aruba-master-icon-library_052722.pptx
PPTX
BSCS lesson 3.pptxnbbjbb mnbkjbkbbkbbkjb
PDF
GREEN BUILDING MATERIALS FOR SUISTAINABLE ARCHITECTURE AND BUILDING STUDY
PPTX
12. Community Pharmacy and How to organize it
PPTX
mahatma gandhi bus terminal in india Case Study.pptx
Wisp Textiles: Where Comfort Meets Everyday Style
The Advantages of Working With a Design-Build Studio
Special finishes, classification and types, explanation
Phone away, tabs closed: No multitasking
UNIT 1 Introduction fnfbbfhfhfbdhdbdto Java.pptx.pdf
High-frequency high-voltage transformer outline drawing
unit 1 ppt.ppthhhhhhhhhhhhhhhhhhhhhhhhhh
areprosthodontics and orthodonticsa text.pptx
AD Bungalow Case studies Sem 2.pptxvwewev
Implications Existing phase plan and its feasibility.pptx
Design Thinking - Module 1 - Introduction To Design Thinking - Dr. Rohan Dasg...
Tenders & Contracts Works _ Services Afzal.pptx
Integrated-2D-and-3D-Animation-Bridging-Dimensions-for-Impactful-Storytelling...
building Planning Overview for step wise design.pptx
Facade & Landscape Lighting Techniques and Trends.pptx.pdf
HPE Aruba-master-icon-library_052722.pptx
BSCS lesson 3.pptxnbbjbb mnbkjbkbbkbbkjb
GREEN BUILDING MATERIALS FOR SUISTAINABLE ARCHITECTURE AND BUILDING STUDY
12. Community Pharmacy and How to organize it
mahatma gandhi bus terminal in india Case Study.pptx

Bindings of components in mule

  • 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.
  • 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.
  • 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.
  • 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 :
  • 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.
  • 13.  The implementation for the component is contained within the <script:script>element as shown below :  return "Total: " + AdditionService.add(1,2)