This page last changed on Oct 02, 2006 by lajos@mulesource.com.

The LoanBroker ESB is based on the current Loan Broker example except it implements a full ESB architecture. The example demonstrates using HTTP/REST, Web Services, EJB and JMS and is configured according to a typical ESB implementation.

There is a presentation from JavaZone 2005 that provides a walk though of the LoanBroker ESB.
For further information and running instructions see the following sections.

Running the Loan Broker ESB

Prerequisites

Prior to running the application, you must download several jars using the supplied build scripts with either Ant (version 1.6.5 or later) or Maven. This means you must have an internet connection available!You should also have the MULE_HOME environment variable set and pointing to the root of your Mule distribution.
 

Preparation

  1. Open a shell*.
  2. From the root of the Mule distribution go to examples/ant/loanbroker-esb or examples/maven/loanbroker-esb
  3. If you are running this example for the first time and want to use Ant (version 1.6.5 or later) to set up the project:
    1. Make sure you are in the examples/ant/loanbroker-esb directory
    2. Run the Ant script - 'ant'
    3. You should see output indicating that the required JARs have been download to the MULE_HOME/lib/user directory
    4. You can now proceed to the "Running" section below
  4. If you are running this example for the first time and want to use Maven to set up the project:
    1. Make sure you are in the examples/maven/loanbroker-esb directory
    2. Run Maven - 'mvn'
    3. You should see output indicating that the required JARs have been download to the MULE_HOME/lib/user directory
    4. You can now proceed to the "Running" section below

Running the Application

Once you have the JDK installed and Maven installed and you have unpacked the Mule distribution you are ready to go.

  1. Open a shell*.
  2. From the root of the Mule distribution goto examples/ant/loanbroker-esb or examples/maven/loanbroker-esb.
  3. Run the script 'loanbroker.bat' or 'loanbroker.sh'
  4. Follow the prompts.

-
*Shell refers to a command shell in unix or linux and command prompt in windows.

LoanBroker ESB

The Loan Broker ESB application uses a JMS message bus to provide a common messaging channel between the different components and applications.

Cannot resolve external resource into attachment.

Component Description
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 based on the list of lenders.

Implementation Details

The following diagram describes the design including the message endpoints and component types. A full description of the Application can be found here.

Cannot resolve external resource into attachment.

Walkthrough

  1. Client application makes a request sending the LoanBroker a CustomerQuoteRequest Message.
  2. LoanBroker creates a LoanQuoteRequest Message. This is the common message format on the bus.
  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.

Mule Config Graph for the Loan Broker ESB

This is a configuration graph generated for the Loan Broker ESB example using the Mule Config Graph Tool. Cool, eh!
(Click on the thumb image for a bigger picture)


Document generated by Confluence on Oct 03, 2006 09:23