SlideShare ist ein Scribd-Unternehmen logo
1 von 39
IMPLEMENTATION IN MULE ESB
VAMSI KRISHNA
AGENDA
• Overview of ESB
• Introduction to Mule
• Mule and JBI
• Real-world Application
ď‚—Application Overview
ď‚—Systems Involved
ď‚—Design Considerations
ď‚—Event Flows
• Implementation with Mule
ď‚—Components
ď‚—Transports
ď‚—Returning the Loan Quote
ď‚—Fault Tolerance
ď‚—Scaling
• Summary
INTRODUCTION TO ESB
What is it?
ď‚—Enterprise Service Bus is an evolving architecture technique to
integrate incompatible business applications over a common
messaging bus.
Why do we need it?
ď‚—Many of the applications we write are in fact integration projects. Only
the most simple applications do not need to interact with other
applications.
Where does SOA fit in?
ď‚—ESB is one architecture style that abides by the rules of a Service
Orientated Architecture.
What is JBI?
ď‚—Java Business Integration (JSR:208) is an emerging standard that
defines common interfaces for components and message exchanges for
application integration.
Does this all sound familiar?
ď‚—There is nothing new about integration, we've been doing it for years.
So why the hype?
PROPERTIES OF AN ESB
• Loosely Coupled
• Event-Driven
• Highly Distributed
• Security/Authorization
• Abstract Endpoints
• Intelligent Routing
• Data Transformation (inbound/outbound)
• Reliable Messaging
• Multi-Protocol Message Bus
• Light Weight
INTRODUCTION TO MULE
• Service container and messaging platform
• Supports a variety of topologies including ESB
• Highly Scalable; uses SEDA event model
• Lightweight and embeddable
• Transactional; Local and Distributed
• Fault tolerance; Exception management
• Secure; authentication/authorization (Using
Spring/Acegi)
• Powerful event routing capabilities (based on EIP book)
• Support for over 20 messaging protocols/transports
• End-to-End Data Transformation
• Management and Monitoring using JMX
• BPEL Support
• Deployment: JAR, WAR, RAR, EAR.
MULE TOPOLOGIES
Enterprise Service Bus
Client/Server and Hub n' Spoke
Peer Network
Pipeline
Enterprise Service Network
MULE AND JBI
Is Mule a JBI container?
There is a separate project called Mule JBI that is a JBI implementation that
reuses the Mule service stack.
Does Mule work with JBI?
You can use Mule transports, components and transformers inside any JBI
container. Mule provides a couple of components that allows JBI
components to subscribe and publish events to and from Mule.
Do Mule and JBI compete?
JBI solves a subset of messaging problems. Mule addresses the basic need
to move any kind of data (not just XML) between services in an
organization
Which is best for me?
Mule of course!
The reason Mule integrates with other JBI engines and provides it own JBI
container is that one integration solution will never satisfy all integration
needs.
Mule levels the playing field allowing you to pick and choose which
technologies to integrate with.
MULE AND JBI DIFFERENCES
JBI
 Described in terms of Service Engines (SEs) which are akin to components
that execute business logic.
 Binding Components (BCs) implement protocols to provide connectivity to
SEs.
 JBI uses a Message Exchange to manage interactions between components.
 Targeted a specifically at integration. Normalized Message
Mule
 Components are POJOs, EJBs, Spring Beans, Remote objects.
 The component never needs to call Mule APIs making them totally portable.
 Flexible endpoint model where a component may have zero or more inbound
and outbound endpoints.
 Message routing is done via routers that are associated with the component.
 Mule is a ubiquitous messaging platform.
 A distributed container for wiring components.
LOAN BROKER
A Real World Example
SHOPPING FOR LOANS
Customer calls different banks to find the best deal.
Each bank asks customer for his or her social security
number, the amount of the loan and the desired term.
Each bank then investigates the customer's credit
background, usually by contacting a credit agency, before it
finally sends the customer a quote.
Once the customer has received quotes from all banks, he or
she can then select the best offer, i.e. the lowest rate. [1]
THE LOAN BROKER
This process can be automated to allow customers to
obtain the best quote on-line from a far broader range
of banks, in much less time than if he or she were to
obtain all the quotes one by one.
 Upon receiving customer request, Loan Broker:
 obtains the credit information for that customer from the credit agency
 requests quotes for the customer from banks listed with the Lender
Service
 sends aggregate compilation of quotes to the customer for selection. [2]
COMPONENTS
Loan Broker Service Receives LoanRequests (customer, SS
number, loan amount, duration) and is
responsible for aggregating LoanQuotes
into response for the request.
Credit Agency Service An external service provider that provides
crediting checking on customers to ensure
the loan amount requested is feesible.
Credit Agency Gateway Marshals a request between the message
bus and the Credit Agency Application.
Lender Service Based on the customer's credit scoring,
loan amount and duration, the lender
service will select banks from which to
request a LoanQuote.
Lender Gateway Marshals a request from the message bus
to the Lender Application.
Banking Gateway Dispatches LoanRequests to one or more
banks.
ORCHESTRATION
LoanBroker (Http/Rest)
 Receives Requests over Http from a client application, such as a web browser.
Credit Agency (EJB)
 Is an EJB application that is managed by the Loan Broker company. It exposes an EJB called
creditAgency with a method getCreditProfile.
Lender Application (VM)
 Is a local component, a Pojo that will determine which lenders should be used.
Banks (SOAP)
 For simplicity of this example all banks expose the same WS interface, though it's quite feasible
to configure Mule to invoke different interfaces for different banks.
Gateways (JMS)
 Gateways marshal the requests from the message bus to external applications and services.
DESIGN CONSIDERATIONS
Constraints
 Application needs to support request/response processing model.
 Will get a high volume of requests.
 Synchronous processing will not give us enough throughput.
Transports
 Using a JMS message bus
 Need to invoke services over JMS, Http/Rest, VM, and SOAP.
 Need to invoke services in external application containers (EJB).
 Expose components as Web services (Banks).
Message
 The message on the bus is referred to as a LoanQuoteRequest. In this
example this is a Java bean but in real scenarios an XML document
would be used.
LOAN BROKER DESIGN
REQUEST EVENT FLOW
1. Client application makes a request sending the LoanBroker a
CustomerQuoteRequest Message.
2. LoanBroker creates a LoanQuoteRequest Message.
3. Mule sends the message to the Credit Agency Gateway via JMS
4. The Gateway marshals the request and invokes the CreditAgency
EJB. The component used in the RelectionMessageBuilder which
automatically attaches the CreditProfile to the LoanQuoteRequest
message.
5. Mule sends the Message to the Lender Gateway via JMS
6. The Gateway uses the VM transport to invoke the Lender
Application.
7. Mule sends the Message to the Banking Gateway via JMS
8. The Banking Gateway in this example invokes the Banks using SOAP.
9. Each of the Banks attaches a quote to the request and sends it back
to the LoanBroker via the ReplyTo address provided by the Banking
Gateway.
10.The ResponseRouter on the Loan Broker Service receives the
responses on the ReplyTo address. It selects the lowest quote
received for the request and returns it to the client.
LOAN BROKER
Implementation with Mule
DESIGN WITH MULE
THE MESSAGE
Lets start by defining the LoanQuoteRequest Message. In this example
the
Message is a Java bean and is the common message format on the bus.
Normally this would be XML, but Mule allows us to pass any data format
around.
public class LoanQuoteRequest implements Serializable
{
/** The request contains Customer info and loan amount and duration*/
private CustomerQuoteRequest customerRequest;
/** credit profile for the customer */
private CreditProfile creditProfile;
/** A list of lenders for this request */
private Bank[] lenders;
/** A loan quote from a bank */
private LoanQuote loanQuote;
.......
}
CLIENT REQUEST
The whole chain of events is initiated with a client request.
This is done over Http using Mule's REST support. It is
described in the Endpoint address –
jetty:rest://localhost:8080/loanbroker
Here we're saying -
 Embed a Jetty Servlet Engine
 Use the Rest servlet for receiving requests
 Listen on localhost:8080
 Bind the Rest servlet to the context /loanbroker
The request from the client would look like –
http://localhost:8080/loanbroker/?name=Ross+Mason&ssn=1234&
loanAmount=10000&loanDuration=24
THE MESSAGE
The Loan Broker endpoint receives the request as a set of Http
parameters, but we need to transform this into a
CustomerQuoteRequest object before the Loan Broker component
receives it.
We do this by configuring a custom transformer on the endpoint.
public Object transform(Object src, UMOEventContext context)
throws TransformerException {
String name = context.getStringProperty("name");
int ssn = context.getIntProperty("ssn");
double amount = context.getDoubleProperty("loanAmount");
double duration = context.getDoubleProperty("loanDuration");
Customer customer = new Customer(name, ssn);
CustomerQuoteRequest request =
new CustomerQuoteRequest(customer, amount, duration);
return request;
}
LOAN BROKER SERVICE
The Loanbroker service actually doesn't need to do anything but trigger the
LoanQuoteRequest on the bus. Mule handles all routing transformation and
passing the quote back to the callee.
The transformer configured on the REST inbound endpoint for the LoanBroker
converts the REST parameters into a CustomerQuoteRequest object.
public class LoanBroker
{
public LoanQuoteRequest requestLoanQuote(
CustomerQuoteRequest request) throws Exception
{
LoanQuoteRequest bqr = new LoanQuoteRequest();
bqr.setCustomerRequest(request);
return bqr;
}
}
LOAN BROKER CONFIGURATION
All the detail is in the Loan Broker configuration.
<mule-descriptor name="LoanBroker"
implementation="org.mule.samples.loanbroker.esb.LoanBroker">
<inbound-router>
<endpoint address="jetty:rest://localhost:8080/loanbroker"/>
</inbound-router>
<outbound-router>
<router className="org.mule.routing.outbound.OutboundPassThroughRouter">
<endpoint address="jms://esb.credit.agency"/>
</router>
</outbound-router>
<response-router timeout="10000">
<endpoint address="jms://esb.loan.quotes"/>
<router className="
org.mule.samples.loanbroker.esb.routers.BankQuotesResponseAggregator"/>
</response-router>
</mule-descriptor>
CREDIT AGENCY GATEWAY
The Credit Agency code is even easier! We use a
standard Mule Component called a
ReflectionMessageBuilder which builds a message
based on a set of results from endpoint invocations.
It will use reflection to determine how to set the result of
the last endpoint invocation as a property on the
master message.
There are other MessageBuilder components such as the
ScriptMessageBuilder component which is a JSR-223
(Scripting) component that allows you to manipulate
the payload after each request using Groovy,
JavaScript, Rhino or any other supported scripting
language.
CREDIT AGENCY CONFIGURATION
<mule-descriptor name="CreditAgencyGateway"
implementation="org.mule.components.builder.ReflectionMessageBuilder">
<inbound-router>
<endpoint address="jms://credit.agency"/>
</inbound-router>
<outbound-router>
<router className="org.mule.routing.outbound.FilteringRouter">
<endpoint address="ejb://localhost:1099/local/CreditAgency?method=getCreditProfile“
transformers=“LoanQuoteRequestToCreditProfileArgs”
responseTransformers="CreditProfileXmlToCreditProfile“/>
<properties>
<list name="methodArgumentTypes">
<entry value="java.lang.String"/>
<entry value="java.lang.String"/>
</list>
</properties>
</endpoint>
<endpoint address="jms://esb.lender.service"/>
</router>
</outbound-router>
</mule-descriptor>
CREDIT AGENCY CONFIGURATION
We invoke the CreditAgency application using an EJB endpoint –
ejb://localhost:1099/local/CreditAgency?method=getCreditProfile
This endpoint tells Mule to –
 Look up an EJB object at localhost:1099
 Use the JNDI name local/CreditAgency
 Invoke the method getCreditProfile on the EJB object
Notice also the transformers and responseTransformers attibutes on
the endpoint. These tell Mule how to marshal for the Application.
 LoanQuoteRequestToCreditProfileArgs – Extracts the method arguments from the request as
an array used to invoke getCreditProfile.
 CreditProfileXmlToCreditProfile – Parses the response Xml and creates a CreditProfile object
that will be set on the LoanQuoteRequest.
LENDER GATEWAY
Lender Service
 The Lender Agency is a Mule component, that receives events
directly using the VM transport.
Leander Gateway
 The Lender Gateway marshals requests from the bus to the lender
service.
LENDER GATEWAY CONFIGURATION
Lender Service
<mule-descriptor name="LenderService" implementation="org.mule.samples.loanbroker.esb.LenderService">
<inbound-router>
<endpoint address="vm://lender.service"/>
</inbound-router>
</mule-descriptor>
Lender Gatway
<mule-descriptor name="LenderGateway”
implementation="org.mule.components.simple.BridgeComponent">
<inbound-router>
<endpoint address="jms://esb.lender.service"/>
</inbound-router>
<outbound-router>
<router className="org.mule.routing.outbound.ChainingRouter">
<endpoint address="vm://lender.service"/>
<endpoint address="jms://esb.banks"/>
</router>
</outbound-router>
</mule-descriptor>
BANKING GATEWAY
The Banking Gateway is responsible for distributing requests to a list of lenders.
The ReciptientList router configured on this gateway is responsible for extracting
the endpoints from the message and invoking them. The RecipientList is a
type of Itinerary-based router that extracts its itinerary as a static list from
the event.
<mule-descriptor name="BankingGateway"
implementation="org.mule.components.simple.BridgeComponent">
<inbound-router>
<endpoint address="jms://esb.banks"/>
</inbound-router>
<outbound-router>
<router className="org.mule.routing.outbound.StaticRecipientList">
<reply-to address="jms://esb.loan.quotes"/>
</router>
</outbound-router>
</mule-descriptor>
BANKS
The banks in this example are just simple beans
that return a fixed interest rate and are exposed
as SOAP services.
<mule-descriptor name="Bank1"
inboundEndpoint="axis:http://localhost:10001/services"
implementation="org.mule.samples.loanbroker.Bank">
</mule-descriptor>
• Note to expose a component as an Axis service all you
need to do is add an Axis endpoint!
CHOOSING THE BEST QUOTE
Once a back has a quote it passes it to Mule which will send
the Quote on the reply-to endpoint specified by the Banking
Gateway.
Looking back at the LoanBroker configuration, there is a
response-router configured as -
<response-router timeout="10000">
<endpoint address="jms://esb.loan.quotes"/>
<router className="org.mule.samples.loanbroker.esb.routers.
BankQuotesResponseAggregator"/>
</response-router>
• The BankQuoteResponseAggregator is responsible for picking the
lowest quote. But before that happens Mule needs to make sure all
responses are received for the request.
• This is done using message correlation managed by Mule.
EVENT CORRELATION
When a event is dispatched from the Banking Gateway a
correlationId and correlationGroupSize is attached to the
SOAP message. This is a function of the Recipient List
router. It attaches the following information -
 CorrelationId – and Id that associates all the dispatched events to the same
group
 CorrelationGroupSize – how many events are in the group.
 CorrelationSequence – the order in which the events were dispatched.
The Response Router reads these correlation headers when
events are received and correlates the events.
When the event group correlation is complete the response-
router invokes itself where developers can plug in custom
logic.
RESPONSE AGGREGATION
The BankQuoteResponseAggregator implements a single method
that works out the lowest quote before passing it back to
Mule to route the response back to the client.
protected UMOMessage aggregateEvents(EventGroup events) throws RoutingException {
. . . .
List list = events.getEvents();
for (Iterator iterator = list.iterator(); iterator.hasNext();) {
event = (UMOEvent) iterator.next();
quote = (LoanQuote)event.getTransformedMessage();
logger.info("Processing quote: " + quote);
if (lowestQuote == null) {
lowestQuote = quote;
} else if (quote.getInterestRate() < lowestQuote.getInterestRate()) {
lowestQuote = quote;
}
}
return new MuleMessage(lowestQuote, event.getProperties());
}
TRANSPORTS
Most Mule transports can be configured using just the endpoint
address. i.e. tcp://localhost:45454 contains all the information
necessary to make a TCP connection.
However for JMS and EJB we need to define configuration properties for
each such as Jndi information.
This is done by configuring connectors in our MuleXml.
TRANSPORT CONFIGURATION
EJB Connector (OpenEJB – Local Server. See http://openejb.org)
<connector name="ejbConnector" className="org.mule.providers.ejb.EjbConnector">
<properties>
<property name="jndiInitialFactory"
value="org.openejb.client.LocalInitialContextFactory"/>
<property name="securityPolicy" value="security.policy"/>
<map name="jndiProviderProperties">
<property name="openejb.base" value="."/>
<property name="openejb.configuration" value="../conf/openejb.conf"/>
</map>
</properties>
</connector>
JMS Connector (ActiveMQ)
<connector name="jmsConnector" className="org.mule.providers.jms.JmsConnector">
<properties>
<property name="connectionFactoryJndiName" value="ConnectionFactory"/>
<property name="jndiInitialFactory"
value="org.activemq.jndi.ActiveMQInitialContextFactory"/>
<property name="specification" value="1.1"/>
</properties>
</connector>
FAULT TOLERANCE
Exception Strategies
 Can be defined on components and connectors
 Can be defined globally of for each connector or component
 Can handle different exception types differently.
 Exception hierarchy provides all available information
 Event payloads can be re-routed on exception
Connection Strategies
 Control how connectors connect to underlying resources
 Allow for flexible retry policies
 Notifications of failed connections
 Consistent endpoint state maintained
 Can alter routing paths based on failed connections
SCALING
SEDA Model
 Mule is SEDA-based, which is an architecture designed for high concurrency and
throughput.
JMS Clustering
 Currently Mule can use JMS clustering to distribute events to a cluster of Mule
Nodes.
Application Server Clustering
 Mule can be embedded inside a JCA container and allow the App server to
manage its resources and cluster instances.
New Clustering Support
 The next release of Mule will provide clustering and distribution using
JGroups/JBossCache.
Load Balancing using Mule
 You can use a Mule instance to provide load-balancing over any transport.
SUMMARY
An ESB integrating a client application and 3 back office systems.
Combined a number of transports including HTTP, JMS, EJB and Web
Services.
Easy to add in Exception handling, transactions, etc. All done through
configuration.
All event routing, management, transformation is handled by Mule.
Very little code to write. Just domain-specific logic.
A fully functional ESB in about an hour!
THANK YOU

Weitere ähnliche Inhalte

Was ist angesagt?

Basics of mule for beginners
Basics of mule for beginnersBasics of mule for beginners
Basics of mule for beginnersSindhu VL
 
Mule real-world-old
Mule real-world-oldMule real-world-old
Mule real-world-oldF K
 
What is Mule ESB
What is Mule ESB What is Mule ESB
What is Mule ESB Nam Le Dinh
 
A Short Introduction of Mule ESB
A Short Introduction of Mule ESBA Short Introduction of Mule ESB
A Short Introduction of Mule ESBSwapnil Sahu
 
Mule ESB
Mule ESBMule ESB
Mule ESBniravn
 
Mule ESB - Integration Simplified
Mule ESB - Integration SimplifiedMule ESB - Integration Simplified
Mule ESB - Integration SimplifiedRich Software
 
Mule ESB Components
Mule ESB Components Mule ESB Components
Mule ESB Components pat_91
 
Core concepts - mule
Core concepts - muleCore concepts - mule
Core concepts - muleSindhu VL
 
4. mule real-world-old
4. mule real-world-old4. mule real-world-old
4. mule real-world-oldAbdulImrankhan7
 
Fundamentals of Mule Esb
Fundamentals of Mule EsbFundamentals of Mule Esb
Fundamentals of Mule EsbPraneethchampion
 
mulesoft at a glance
mulesoft at a glancemulesoft at a glance
mulesoft at a glanceKhasim Saheb
 
Complete integration with mule esb
Complete integration with mule esbComplete integration with mule esb
Complete integration with mule esbSon Nguyen
 
Mule esb beginner’s guide
Mule esb beginner’s guideMule esb beginner’s guide
Mule esb beginner’s guideD.Rajesh Kumar
 

Was ist angesagt? (20)

Mule ESB
Mule ESBMule ESB
Mule ESB
 
Basics of mule for beginners
Basics of mule for beginnersBasics of mule for beginners
Basics of mule for beginners
 
Mule real-world-old
Mule real-world-oldMule real-world-old
Mule real-world-old
 
What is Mule ESB
What is Mule ESB What is Mule ESB
What is Mule ESB
 
Mule ESB Training
Mule ESB TrainingMule ESB Training
Mule ESB Training
 
A Short Introduction of Mule ESB
A Short Introduction of Mule ESBA Short Introduction of Mule ESB
A Short Introduction of Mule ESB
 
Mule ESB
Mule ESBMule ESB
Mule ESB
 
Mule ESB - Integration Simplified
Mule ESB - Integration SimplifiedMule ESB - Integration Simplified
Mule ESB - Integration Simplified
 
Mule ESB Components
Mule ESB Components Mule ESB Components
Mule ESB Components
 
Mule real-world-old
Mule real-world-oldMule real-world-old
Mule real-world-old
 
Mule ESB Fundamentals
Mule ESB FundamentalsMule ESB Fundamentals
Mule ESB Fundamentals
 
Core concepts - mule
Core concepts - muleCore concepts - mule
Core concepts - mule
 
4. mule real-world-old
4. mule real-world-old4. mule real-world-old
4. mule real-world-old
 
Mule soa
Mule soaMule soa
Mule soa
 
Fundamentals of Mule Esb
Fundamentals of Mule EsbFundamentals of Mule Esb
Fundamentals of Mule Esb
 
mulesoft at a glance
mulesoft at a glancemulesoft at a glance
mulesoft at a glance
 
Mule execution
Mule executionMule execution
Mule execution
 
Complete integration with mule esb
Complete integration with mule esbComplete integration with mule esb
Complete integration with mule esb
 
Mule esb beginner’s guide
Mule esb beginner’s guideMule esb beginner’s guide
Mule esb beginner’s guide
 
Mule esb
Mule esbMule esb
Mule esb
 

Andere mochten auch

ESB Overview
ESB OverviewESB Overview
ESB OverviewBahaa Farouk
 
Introduction to Enterprise Service Bus
Introduction to Enterprise Service BusIntroduction to Enterprise Service Bus
Introduction to Enterprise Service BusMahmoud Ezzat
 
Cloudify your applications with Amazon Web Services
Cloudify your applications with Amazon Web ServicesCloudify your applications with Amazon Web Services
Cloudify your applications with Amazon Web ServicesFederico Feroldi
 
Mule esb basic introduction
Mule esb basic introductionMule esb basic introduction
Mule esb basic introductionSon Nguyen
 
SpringPeople Introduction to Mule ESB
SpringPeople Introduction to Mule ESBSpringPeople Introduction to Mule ESB
SpringPeople Introduction to Mule ESBSpringPeople
 
Introduction to Node.JS Express
Introduction to Node.JS ExpressIntroduction to Node.JS Express
Introduction to Node.JS ExpressEueung Mulyana
 
EAIESB TIBCO EXPERTISE
EAIESB TIBCO EXPERTISEEAIESB TIBCO EXPERTISE
EAIESB TIBCO EXPERTISEVijay Reddy
 
Node Js, AngularJs and Express Js Tutorial
Node Js, AngularJs and Express Js TutorialNode Js, AngularJs and Express Js Tutorial
Node Js, AngularJs and Express Js TutorialPHP Support
 
Mule connectors
Mule connectorsMule connectors
Mule connectorsVamsi Krishna
 
Developer’s viewpoint on swift programming language
Developer’s viewpoint on swift programming languageDeveloper’s viewpoint on swift programming language
Developer’s viewpoint on swift programming languageAzilen Technologies Pvt. Ltd.
 
Administration and Management with UltraESB
Administration and Management with UltraESBAdministration and Management with UltraESB
Administration and Management with UltraESBAdroitLogic
 
Debug Program in Mule
Debug Program in MuleDebug Program in Mule
Debug Program in MuleVamsi Krishna
 
ESB 4.9.0 extension points, Connectors and Inbound Endpoints
ESB 4.9.0 extension points, Connectors and Inbound Endpoints ESB 4.9.0 extension points, Connectors and Inbound Endpoints
ESB 4.9.0 extension points, Connectors and Inbound Endpoints WSO2
 
Enterprise Integration made easy with WSO2 ESB
Enterprise Integration made easy with WSO2 ESBEnterprise Integration made easy with WSO2 ESB
Enterprise Integration made easy with WSO2 ESBWSO2
 
WSO2 ESB and SOA
WSO2 ESB and SOAWSO2 ESB and SOA
WSO2 ESB and SOAWSO2
 

Andere mochten auch (20)

ESB Overview
ESB OverviewESB Overview
ESB Overview
 
Overview of ESB at Azilen Tech Meetup
Overview of ESB at Azilen Tech MeetupOverview of ESB at Azilen Tech Meetup
Overview of ESB at Azilen Tech Meetup
 
Mule esb presentation
Mule esb presentationMule esb presentation
Mule esb presentation
 
Introduction to Enterprise Service Bus
Introduction to Enterprise Service BusIntroduction to Enterprise Service Bus
Introduction to Enterprise Service Bus
 
Cloudify your applications with Amazon Web Services
Cloudify your applications with Amazon Web ServicesCloudify your applications with Amazon Web Services
Cloudify your applications with Amazon Web Services
 
Mule esb basic introduction
Mule esb basic introductionMule esb basic introduction
Mule esb basic introduction
 
SpringPeople Introduction to Mule ESB
SpringPeople Introduction to Mule ESBSpringPeople Introduction to Mule ESB
SpringPeople Introduction to Mule ESB
 
Introduction to Node.JS Express
Introduction to Node.JS ExpressIntroduction to Node.JS Express
Introduction to Node.JS Express
 
EAIESB TIBCO EXPERTISE
EAIESB TIBCO EXPERTISEEAIESB TIBCO EXPERTISE
EAIESB TIBCO EXPERTISE
 
Node Js, AngularJs and Express Js Tutorial
Node Js, AngularJs and Express Js TutorialNode Js, AngularJs and Express Js Tutorial
Node Js, AngularJs and Express Js Tutorial
 
Siddhi CEP 1st presentation
Siddhi CEP 1st presentationSiddhi CEP 1st presentation
Siddhi CEP 1st presentation
 
Siddhi CEP 2nd sideshow presentation
Siddhi CEP 2nd sideshow presentationSiddhi CEP 2nd sideshow presentation
Siddhi CEP 2nd sideshow presentation
 
Mule connectors
Mule connectorsMule connectors
Mule connectors
 
Developer’s viewpoint on swift programming language
Developer’s viewpoint on swift programming languageDeveloper’s viewpoint on swift programming language
Developer’s viewpoint on swift programming language
 
Administration and Management with UltraESB
Administration and Management with UltraESBAdministration and Management with UltraESB
Administration and Management with UltraESB
 
Debug Program in Mule
Debug Program in MuleDebug Program in Mule
Debug Program in Mule
 
Wso2 esb
Wso2 esbWso2 esb
Wso2 esb
 
ESB 4.9.0 extension points, Connectors and Inbound Endpoints
ESB 4.9.0 extension points, Connectors and Inbound Endpoints ESB 4.9.0 extension points, Connectors and Inbound Endpoints
ESB 4.9.0 extension points, Connectors and Inbound Endpoints
 
Enterprise Integration made easy with WSO2 ESB
Enterprise Integration made easy with WSO2 ESBEnterprise Integration made easy with WSO2 ESB
Enterprise Integration made easy with WSO2 ESB
 
WSO2 ESB and SOA
WSO2 ESB and SOAWSO2 ESB and SOA
WSO2 ESB and SOA
 

Ă„hnlich wie Implement Mule ESB for Loan Broker Application

Development using anypointstudio
Development using anypointstudioDevelopment using anypointstudio
Development using anypointstudiohimajareddys
 
4 150915033746-lva1-app6892
4 150915033746-lva1-app68924 150915033746-lva1-app6892
4 150915033746-lva1-app6892ppts123456
 
Mule execution
Mule executionMule execution
Mule executionPhaniu
 
Mule execution
Mule executionMule execution
Mule executionirfan1008
 
Implementing ESB
Implementing ESBImplementing ESB
Implementing ESBmdfkhan625
 
Javazone 2005-mule-real-world-old
Javazone 2005-mule-real-world-oldJavazone 2005-mule-real-world-old
Javazone 2005-mule-real-world-oldtdlrobin
 
Mule Fundamentals
Mule FundamentalsMule Fundamentals
Mule FundamentalsKhasim Cise
 
Mule execution
Mule executionMule execution
Mule executionAnand kalla
 
mule real world
mule real worldmule real world
mule real worldRajkattamuri
 
Mule real world old
Mule real world oldMule real world old
Mule real world oldMohammed625
 
Enhancement in Web Service Architecture
Enhancement in Web Service ArchitectureEnhancement in Web Service Architecture
Enhancement in Web Service ArchitectureIJERA Editor
 
WCF tutorial
WCF tutorialWCF tutorial
WCF tutorialAbhi Arya
 
Meetup6 microservices for the IoT
Meetup6 microservices for the IoTMeetup6 microservices for the IoT
Meetup6 microservices for the IoTFrancesco Rago
 
Web Basics
Web BasicsWeb Basics
Web BasicsHui Xie
 
IBM Innovate 2013: Making Rational HATS a Strategic Investment
IBM Innovate 2013: Making Rational HATS a Strategic InvestmentIBM Innovate 2013: Making Rational HATS a Strategic Investment
IBM Innovate 2013: Making Rational HATS a Strategic InvestmentStrongback Consulting
 

Ă„hnlich wie Implement Mule ESB for Loan Broker Application (20)

Development using anypointstudio
Development using anypointstudioDevelopment using anypointstudio
Development using anypointstudio
 
4 150915033746-lva1-app6892
4 150915033746-lva1-app68924 150915033746-lva1-app6892
4 150915033746-lva1-app6892
 
Mule execution
Mule executionMule execution
Mule execution
 
Mule execution
Mule executionMule execution
Mule execution
 
Mule execution
Mule executionMule execution
Mule execution
 
Mule execution
Mule executionMule execution
Mule execution
 
Mule execution
Mule executionMule execution
Mule execution
 
Implementing ESB
Implementing ESBImplementing ESB
Implementing ESB
 
Javazone 2005-mule-real-world-old
Javazone 2005-mule-real-world-oldJavazone 2005-mule-real-world-old
Javazone 2005-mule-real-world-old
 
Mule Fundamentals
Mule FundamentalsMule Fundamentals
Mule Fundamentals
 
Mule execution
Mule executionMule execution
Mule execution
 
mule real world
mule real worldmule real world
mule real world
 
Mule real-world
Mule real-worldMule real-world
Mule real-world
 
Mule real world old
Mule real world oldMule real world old
Mule real world old
 
Enhancement in Web Service Architecture
Enhancement in Web Service ArchitectureEnhancement in Web Service Architecture
Enhancement in Web Service Architecture
 
WCF tutorial
WCF tutorialWCF tutorial
WCF tutorial
 
Meetup6 microservices for the IoT
Meetup6 microservices for the IoTMeetup6 microservices for the IoT
Meetup6 microservices for the IoT
 
Microservices
MicroservicesMicroservices
Microservices
 
Web Basics
Web BasicsWeb Basics
Web Basics
 
IBM Innovate 2013: Making Rational HATS a Strategic Investment
IBM Innovate 2013: Making Rational HATS a Strategic InvestmentIBM Innovate 2013: Making Rational HATS a Strategic Investment
IBM Innovate 2013: Making Rational HATS a Strategic Investment
 

Mehr von Vamsi Krishna

Mulesoft - Documentation (Automation)
Mulesoft - Documentation (Automation)Mulesoft - Documentation (Automation)
Mulesoft - Documentation (Automation)Vamsi Krishna
 
Mule esb intoduction
Mule esb intoductionMule esb intoduction
Mule esb intoductionVamsi Krishna
 
Architecture of mule
Architecture of muleArchitecture of mule
Architecture of muleVamsi Krishna
 
Email configuration in mule esb
Email configuration in mule esbEmail configuration in mule esb
Email configuration in mule esbVamsi Krishna
 
How to create users with anypoint studio
How to create users with anypoint studioHow to create users with anypoint studio
How to create users with anypoint studioVamsi Krishna
 
Mule integration
Mule integrationMule integration
Mule integrationVamsi Krishna
 
Hadoop connector
Hadoop connectorHadoop connector
Hadoop connectorVamsi Krishna
 

Mehr von Vamsi Krishna (8)

Mulesoft - Documentation (Automation)
Mulesoft - Documentation (Automation)Mulesoft - Documentation (Automation)
Mulesoft - Documentation (Automation)
 
Mule esb intoduction
Mule esb intoductionMule esb intoduction
Mule esb intoduction
 
Architecture of mule
Architecture of muleArchitecture of mule
Architecture of mule
 
Email configuration in mule esb
Email configuration in mule esbEmail configuration in mule esb
Email configuration in mule esb
 
How to create users with anypoint studio
How to create users with anypoint studioHow to create users with anypoint studio
How to create users with anypoint studio
 
Mule integration
Mule integrationMule integration
Mule integration
 
Mule SIS
Mule SISMule SIS
Mule SIS
 
Hadoop connector
Hadoop connectorHadoop connector
Hadoop connector
 

KĂĽrzlich hochgeladen

How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPCeline George
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Mark Reed
 
4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptxmary850239
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)lakshayb543
 
Concurrency Control in Database Management system
Concurrency Control in Database Management systemConcurrency Control in Database Management system
Concurrency Control in Database Management systemChristalin Nelson
 
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Celine George
 
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...JojoEDelaCruz
 
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfInclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfTechSoup
 
Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Seán Kennedy
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parentsnavabharathschool99
 
Presentation Activity 2. Unit 3 transv.pptx
Presentation Activity 2. Unit 3 transv.pptxPresentation Activity 2. Unit 3 transv.pptx
Presentation Activity 2. Unit 3 transv.pptxRosabel UA
 
How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17Celine George
 
Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4JOYLYNSAMANIEGO
 
The Contemporary World: The Globalization of World Politics
The Contemporary World: The Globalization of World PoliticsThe Contemporary World: The Globalization of World Politics
The Contemporary World: The Globalization of World PoliticsRommel Regala
 
Expanded definition: technical and operational
Expanded definition: technical and operationalExpanded definition: technical and operational
Expanded definition: technical and operationalssuser3e220a
 
Textual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHSTextual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHSMae Pangan
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designMIPLM
 
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSGRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSJoshuaGantuangco2
 

KĂĽrzlich hochgeladen (20)

How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERP
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)
 
4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
 
Concurrency Control in Database Management system
Concurrency Control in Database Management systemConcurrency Control in Database Management system
Concurrency Control in Database Management system
 
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
 
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
 
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfInclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
 
INCLUSIVE EDUCATION PRACTICES FOR TEACHERS AND TRAINERS.pptx
INCLUSIVE EDUCATION PRACTICES FOR TEACHERS AND TRAINERS.pptxINCLUSIVE EDUCATION PRACTICES FOR TEACHERS AND TRAINERS.pptx
INCLUSIVE EDUCATION PRACTICES FOR TEACHERS AND TRAINERS.pptx
 
Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parents
 
Presentation Activity 2. Unit 3 transv.pptx
Presentation Activity 2. Unit 3 transv.pptxPresentation Activity 2. Unit 3 transv.pptx
Presentation Activity 2. Unit 3 transv.pptx
 
How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17
 
Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4
 
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptxLEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
 
The Contemporary World: The Globalization of World Politics
The Contemporary World: The Globalization of World PoliticsThe Contemporary World: The Globalization of World Politics
The Contemporary World: The Globalization of World Politics
 
Expanded definition: technical and operational
Expanded definition: technical and operationalExpanded definition: technical and operational
Expanded definition: technical and operational
 
Textual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHSTextual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHS
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-design
 
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSGRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
 

Implement Mule ESB for Loan Broker Application

  • 1. IMPLEMENTATION IN MULE ESB VAMSI KRISHNA
  • 2. AGENDA • Overview of ESB • Introduction to Mule • Mule and JBI • Real-world Application ď‚—Application Overview ď‚—Systems Involved ď‚—Design Considerations ď‚—Event Flows • Implementation with Mule ď‚—Components ď‚—Transports ď‚—Returning the Loan Quote ď‚—Fault Tolerance ď‚—Scaling • Summary
  • 3. INTRODUCTION TO ESB What is it? ď‚—Enterprise Service Bus is an evolving architecture technique to integrate incompatible business applications over a common messaging bus. Why do we need it? ď‚—Many of the applications we write are in fact integration projects. Only the most simple applications do not need to interact with other applications. Where does SOA fit in? ď‚—ESB is one architecture style that abides by the rules of a Service Orientated Architecture. What is JBI? ď‚—Java Business Integration (JSR:208) is an emerging standard that defines common interfaces for components and message exchanges for application integration. Does this all sound familiar? ď‚—There is nothing new about integration, we've been doing it for years. So why the hype?
  • 4. PROPERTIES OF AN ESB • Loosely Coupled • Event-Driven • Highly Distributed • Security/Authorization • Abstract Endpoints • Intelligent Routing • Data Transformation (inbound/outbound) • Reliable Messaging • Multi-Protocol Message Bus • Light Weight
  • 5. INTRODUCTION TO MULE • Service container and messaging platform • Supports a variety of topologies including ESB • Highly Scalable; uses SEDA event model • Lightweight and embeddable • Transactional; Local and Distributed • Fault tolerance; Exception management • Secure; authentication/authorization (Using Spring/Acegi) • Powerful event routing capabilities (based on EIP book) • Support for over 20 messaging protocols/transports • End-to-End Data Transformation • Management and Monitoring using JMX • BPEL Support • Deployment: JAR, WAR, RAR, EAR.
  • 6. MULE TOPOLOGIES Enterprise Service Bus Client/Server and Hub n' Spoke Peer Network Pipeline Enterprise Service Network
  • 7. MULE AND JBI Is Mule a JBI container? There is a separate project called Mule JBI that is a JBI implementation that reuses the Mule service stack. Does Mule work with JBI? You can use Mule transports, components and transformers inside any JBI container. Mule provides a couple of components that allows JBI components to subscribe and publish events to and from Mule. Do Mule and JBI compete? JBI solves a subset of messaging problems. Mule addresses the basic need to move any kind of data (not just XML) between services in an organization Which is best for me? Mule of course! The reason Mule integrates with other JBI engines and provides it own JBI container is that one integration solution will never satisfy all integration needs. Mule levels the playing field allowing you to pick and choose which technologies to integrate with.
  • 8. MULE AND JBI DIFFERENCES JBI  Described in terms of Service Engines (SEs) which are akin to components that execute business logic.  Binding Components (BCs) implement protocols to provide connectivity to SEs.  JBI uses a Message Exchange to manage interactions between components.  Targeted a specifically at integration. Normalized Message Mule  Components are POJOs, EJBs, Spring Beans, Remote objects.  The component never needs to call Mule APIs making them totally portable.  Flexible endpoint model where a component may have zero or more inbound and outbound endpoints.  Message routing is done via routers that are associated with the component.  Mule is a ubiquitous messaging platform.  A distributed container for wiring components.
  • 9. LOAN BROKER A Real World Example
  • 10. SHOPPING FOR LOANS Customer calls different banks to find the best deal. Each bank asks customer for his or her social security number, the amount of the loan and the desired term. Each bank then investigates the customer's credit background, usually by contacting a credit agency, before it finally sends the customer a quote. Once the customer has received quotes from all banks, he or she can then select the best offer, i.e. the lowest rate. [1]
  • 11. THE LOAN BROKER This process can be automated to allow customers to obtain the best quote on-line from a far broader range of banks, in much less time than if he or she were to obtain all the quotes one by one.  Upon receiving customer request, Loan Broker:  obtains the credit information for that customer from the credit agency  requests quotes for the customer from banks listed with the Lender Service  sends aggregate compilation of quotes to the customer for selection. [2]
  • 12. COMPONENTS Loan Broker Service Receives LoanRequests (customer, SS number, loan amount, duration) and is responsible for aggregating LoanQuotes into response for the request. Credit Agency Service An external service provider that provides crediting checking on customers to ensure the loan amount requested is feesible. Credit Agency Gateway Marshals a request between the message bus and the Credit Agency Application. Lender Service Based on the customer's credit scoring, loan amount and duration, the lender service will select banks from which to request a LoanQuote. Lender Gateway Marshals a request from the message bus to the Lender Application. Banking Gateway Dispatches LoanRequests to one or more banks.
  • 13. ORCHESTRATION LoanBroker (Http/Rest)  Receives Requests over Http from a client application, such as a web browser. Credit Agency (EJB)  Is an EJB application that is managed by the Loan Broker company. It exposes an EJB called creditAgency with a method getCreditProfile. Lender Application (VM)  Is a local component, a Pojo that will determine which lenders should be used. Banks (SOAP)  For simplicity of this example all banks expose the same WS interface, though it's quite feasible to configure Mule to invoke different interfaces for different banks. Gateways (JMS)  Gateways marshal the requests from the message bus to external applications and services.
  • 14. DESIGN CONSIDERATIONS Constraints  Application needs to support request/response processing model.  Will get a high volume of requests.  Synchronous processing will not give us enough throughput. Transports  Using a JMS message bus  Need to invoke services over JMS, Http/Rest, VM, and SOAP.  Need to invoke services in external application containers (EJB).  Expose components as Web services (Banks). Message  The message on the bus is referred to as a LoanQuoteRequest. In this example this is a Java bean but in real scenarios an XML document would be used.
  • 16. REQUEST EVENT FLOW 1. Client application makes a request sending the LoanBroker a CustomerQuoteRequest Message. 2. LoanBroker creates a LoanQuoteRequest Message. 3. Mule sends the message to the Credit Agency Gateway via JMS 4. The Gateway marshals the request and invokes the CreditAgency EJB. The component used in the RelectionMessageBuilder which automatically attaches the CreditProfile to the LoanQuoteRequest message. 5. Mule sends the Message to the Lender Gateway via JMS 6. The Gateway uses the VM transport to invoke the Lender Application. 7. Mule sends the Message to the Banking Gateway via JMS 8. The Banking Gateway in this example invokes the Banks using SOAP. 9. Each of the Banks attaches a quote to the request and sends it back to the LoanBroker via the ReplyTo address provided by the Banking Gateway. 10.The ResponseRouter on the Loan Broker Service receives the responses on the ReplyTo address. It selects the lowest quote received for the request and returns it to the client.
  • 19. THE MESSAGE Lets start by defining the LoanQuoteRequest Message. In this example the Message is a Java bean and is the common message format on the bus. Normally this would be XML, but Mule allows us to pass any data format around. public class LoanQuoteRequest implements Serializable { /** The request contains Customer info and loan amount and duration*/ private CustomerQuoteRequest customerRequest; /** credit profile for the customer */ private CreditProfile creditProfile; /** A list of lenders for this request */ private Bank[] lenders; /** A loan quote from a bank */ private LoanQuote loanQuote; ....... }
  • 20. CLIENT REQUEST The whole chain of events is initiated with a client request. This is done over Http using Mule's REST support. It is described in the Endpoint address – jetty:rest://localhost:8080/loanbroker Here we're saying -  Embed a Jetty Servlet Engine  Use the Rest servlet for receiving requests  Listen on localhost:8080  Bind the Rest servlet to the context /loanbroker The request from the client would look like – http://localhost:8080/loanbroker/?name=Ross+Mason&ssn=1234& loanAmount=10000&loanDuration=24
  • 21. THE MESSAGE The Loan Broker endpoint receives the request as a set of Http parameters, but we need to transform this into a CustomerQuoteRequest object before the Loan Broker component receives it. We do this by configuring a custom transformer on the endpoint. public Object transform(Object src, UMOEventContext context) throws TransformerException { String name = context.getStringProperty("name"); int ssn = context.getIntProperty("ssn"); double amount = context.getDoubleProperty("loanAmount"); double duration = context.getDoubleProperty("loanDuration"); Customer customer = new Customer(name, ssn); CustomerQuoteRequest request = new CustomerQuoteRequest(customer, amount, duration); return request; }
  • 22. LOAN BROKER SERVICE The Loanbroker service actually doesn't need to do anything but trigger the LoanQuoteRequest on the bus. Mule handles all routing transformation and passing the quote back to the callee. The transformer configured on the REST inbound endpoint for the LoanBroker converts the REST parameters into a CustomerQuoteRequest object. public class LoanBroker { public LoanQuoteRequest requestLoanQuote( CustomerQuoteRequest request) throws Exception { LoanQuoteRequest bqr = new LoanQuoteRequest(); bqr.setCustomerRequest(request); return bqr; } }
  • 23. LOAN BROKER CONFIGURATION All the detail is in the Loan Broker configuration. <mule-descriptor name="LoanBroker" implementation="org.mule.samples.loanbroker.esb.LoanBroker"> <inbound-router> <endpoint address="jetty:rest://localhost:8080/loanbroker"/> </inbound-router> <outbound-router> <router className="org.mule.routing.outbound.OutboundPassThroughRouter"> <endpoint address="jms://esb.credit.agency"/> </router> </outbound-router> <response-router timeout="10000"> <endpoint address="jms://esb.loan.quotes"/> <router className=" org.mule.samples.loanbroker.esb.routers.BankQuotesResponseAggregator"/> </response-router> </mule-descriptor>
  • 24. CREDIT AGENCY GATEWAY The Credit Agency code is even easier! We use a standard Mule Component called a ReflectionMessageBuilder which builds a message based on a set of results from endpoint invocations. It will use reflection to determine how to set the result of the last endpoint invocation as a property on the master message. There are other MessageBuilder components such as the ScriptMessageBuilder component which is a JSR-223 (Scripting) component that allows you to manipulate the payload after each request using Groovy, JavaScript, Rhino or any other supported scripting language.
  • 25. CREDIT AGENCY CONFIGURATION <mule-descriptor name="CreditAgencyGateway" implementation="org.mule.components.builder.ReflectionMessageBuilder"> <inbound-router> <endpoint address="jms://credit.agency"/> </inbound-router> <outbound-router> <router className="org.mule.routing.outbound.FilteringRouter"> <endpoint address="ejb://localhost:1099/local/CreditAgency?method=getCreditProfile“ transformers=“LoanQuoteRequestToCreditProfileArgs” responseTransformers="CreditProfileXmlToCreditProfile“/> <properties> <list name="methodArgumentTypes"> <entry value="java.lang.String"/> <entry value="java.lang.String"/> </list> </properties> </endpoint> <endpoint address="jms://esb.lender.service"/> </router> </outbound-router> </mule-descriptor>
  • 26. CREDIT AGENCY CONFIGURATION We invoke the CreditAgency application using an EJB endpoint – ejb://localhost:1099/local/CreditAgency?method=getCreditProfile This endpoint tells Mule to –  Look up an EJB object at localhost:1099  Use the JNDI name local/CreditAgency  Invoke the method getCreditProfile on the EJB object Notice also the transformers and responseTransformers attibutes on the endpoint. These tell Mule how to marshal for the Application.  LoanQuoteRequestToCreditProfileArgs – Extracts the method arguments from the request as an array used to invoke getCreditProfile.  CreditProfileXmlToCreditProfile – Parses the response Xml and creates a CreditProfile object that will be set on the LoanQuoteRequest.
  • 27. LENDER GATEWAY Lender Service  The Lender Agency is a Mule component, that receives events directly using the VM transport. Leander Gateway  The Lender Gateway marshals requests from the bus to the lender service.
  • 28. LENDER GATEWAY CONFIGURATION Lender Service <mule-descriptor name="LenderService" implementation="org.mule.samples.loanbroker.esb.LenderService"> <inbound-router> <endpoint address="vm://lender.service"/> </inbound-router> </mule-descriptor> Lender Gatway <mule-descriptor name="LenderGateway” implementation="org.mule.components.simple.BridgeComponent"> <inbound-router> <endpoint address="jms://esb.lender.service"/> </inbound-router> <outbound-router> <router className="org.mule.routing.outbound.ChainingRouter"> <endpoint address="vm://lender.service"/> <endpoint address="jms://esb.banks"/> </router> </outbound-router> </mule-descriptor>
  • 29. BANKING GATEWAY The Banking Gateway is responsible for distributing requests to a list of lenders. The ReciptientList router configured on this gateway is responsible for extracting the endpoints from the message and invoking them. The RecipientList is a type of Itinerary-based router that extracts its itinerary as a static list from the event. <mule-descriptor name="BankingGateway" implementation="org.mule.components.simple.BridgeComponent"> <inbound-router> <endpoint address="jms://esb.banks"/> </inbound-router> <outbound-router> <router className="org.mule.routing.outbound.StaticRecipientList"> <reply-to address="jms://esb.loan.quotes"/> </router> </outbound-router> </mule-descriptor>
  • 30. BANKS The banks in this example are just simple beans that return a fixed interest rate and are exposed as SOAP services. <mule-descriptor name="Bank1" inboundEndpoint="axis:http://localhost:10001/services" implementation="org.mule.samples.loanbroker.Bank"> </mule-descriptor> • Note to expose a component as an Axis service all you need to do is add an Axis endpoint!
  • 31. CHOOSING THE BEST QUOTE Once a back has a quote it passes it to Mule which will send the Quote on the reply-to endpoint specified by the Banking Gateway. Looking back at the LoanBroker configuration, there is a response-router configured as - <response-router timeout="10000"> <endpoint address="jms://esb.loan.quotes"/> <router className="org.mule.samples.loanbroker.esb.routers. BankQuotesResponseAggregator"/> </response-router> • The BankQuoteResponseAggregator is responsible for picking the lowest quote. But before that happens Mule needs to make sure all responses are received for the request. • This is done using message correlation managed by Mule.
  • 32. EVENT CORRELATION When a event is dispatched from the Banking Gateway a correlationId and correlationGroupSize is attached to the SOAP message. This is a function of the Recipient List router. It attaches the following information -  CorrelationId – and Id that associates all the dispatched events to the same group  CorrelationGroupSize – how many events are in the group.  CorrelationSequence – the order in which the events were dispatched. The Response Router reads these correlation headers when events are received and correlates the events. When the event group correlation is complete the response- router invokes itself where developers can plug in custom logic.
  • 33. RESPONSE AGGREGATION The BankQuoteResponseAggregator implements a single method that works out the lowest quote before passing it back to Mule to route the response back to the client. protected UMOMessage aggregateEvents(EventGroup events) throws RoutingException { . . . . List list = events.getEvents(); for (Iterator iterator = list.iterator(); iterator.hasNext();) { event = (UMOEvent) iterator.next(); quote = (LoanQuote)event.getTransformedMessage(); logger.info("Processing quote: " + quote); if (lowestQuote == null) { lowestQuote = quote; } else if (quote.getInterestRate() < lowestQuote.getInterestRate()) { lowestQuote = quote; } } return new MuleMessage(lowestQuote, event.getProperties()); }
  • 34. TRANSPORTS Most Mule transports can be configured using just the endpoint address. i.e. tcp://localhost:45454 contains all the information necessary to make a TCP connection. However for JMS and EJB we need to define configuration properties for each such as Jndi information. This is done by configuring connectors in our MuleXml.
  • 35. TRANSPORT CONFIGURATION EJB Connector (OpenEJB – Local Server. See http://openejb.org) <connector name="ejbConnector" className="org.mule.providers.ejb.EjbConnector"> <properties> <property name="jndiInitialFactory" value="org.openejb.client.LocalInitialContextFactory"/> <property name="securityPolicy" value="security.policy"/> <map name="jndiProviderProperties"> <property name="openejb.base" value="."/> <property name="openejb.configuration" value="../conf/openejb.conf"/> </map> </properties> </connector> JMS Connector (ActiveMQ) <connector name="jmsConnector" className="org.mule.providers.jms.JmsConnector"> <properties> <property name="connectionFactoryJndiName" value="ConnectionFactory"/> <property name="jndiInitialFactory" value="org.activemq.jndi.ActiveMQInitialContextFactory"/> <property name="specification" value="1.1"/> </properties> </connector>
  • 36. FAULT TOLERANCE Exception Strategies  Can be defined on components and connectors  Can be defined globally of for each connector or component  Can handle different exception types differently.  Exception hierarchy provides all available information  Event payloads can be re-routed on exception Connection Strategies  Control how connectors connect to underlying resources  Allow for flexible retry policies  Notifications of failed connections  Consistent endpoint state maintained  Can alter routing paths based on failed connections
  • 37. SCALING SEDA Model  Mule is SEDA-based, which is an architecture designed for high concurrency and throughput. JMS Clustering  Currently Mule can use JMS clustering to distribute events to a cluster of Mule Nodes. Application Server Clustering  Mule can be embedded inside a JCA container and allow the App server to manage its resources and cluster instances. New Clustering Support  The next release of Mule will provide clustering and distribution using JGroups/JBossCache. Load Balancing using Mule  You can use a Mule instance to provide load-balancing over any transport.
  • 38. SUMMARY An ESB integrating a client application and 3 back office systems. Combined a number of transports including HTTP, JMS, EJB and Web Services. Easy to add in Exception handling, transactions, etc. All done through configuration. All event routing, management, transformation is handled by Mule. Very little code to write. Just domain-specific logic. A fully functional ESB in about an hour!