All Downloads are FREE. Search and download functionalities are using the official Maven repository.

ples.mule-example-loanbroker-esn.3.5.0-bighorn.source-code.loan-broker-sync-config.xml Maven / Gradle / Ivy

<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns="http://www.mulesoft.org/schema/mule/core"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xmlns:spring="http://www.springframework.org/schema/beans"
        xmlns:vm="http://www.mulesoft.org/schema/mule/vm"
        xmlns:client="http://www.mulesoft.org/schema/mule/client"
        xsi:schemaLocation="
                http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd
                http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
                http://www.mulesoft.org/schema/mule/client http://www.mulesoft.org/schema/mule/client/current/mule-client.xsd
                http://www.mulesoft.org/schema/mule/vm http://www.mulesoft.org/schema/mule/vm/current/mule-vm.xsd">
   
     <description>
     This loan broker example is modeled on the Enterprise integration Patterns book sample.
     This implementation differs in that this configuration uses a synchronous model where
     each component is invoked from the LoanBroker component.
     </description>

    <client:remote-dispatcher-agent>
        <client:remote-endpoint address="tcp://localhost:5555" exchange-pattern="request-response"/>
    </client:remote-dispatcher-agent>

     <!-- Synchronous VM connector (messages are processed in the same execution thread) -->
     <vm:connector name="syncVm"/>

    <!--
       The Mule model initialises and manages your Mule components
     -->
    <model name="loan-broker">

             <!--
             The loan broker is used to receive loan requests
             -->
             <service name="TheLoanBroker">
                 <inbound>
                     <inbound-endpoint ref="CustomerRequests" exchange-pattern="request-response"/>
                 </inbound>

                 <component class="org.mule.example.loanbroker.esn.SynchronousLoanBroker">
                     <binding interface="org.mule.example.loanbroker.credit.CreditAgencyService">
                         <outbound-endpoint ref="CreditAgency"/>
                     </binding>
                 </component>

                 <outbound>
                     <pass-through-router>
                         <outbound-endpoint ref="LenderService"/>
                     </pass-through-router>
                 </outbound>

                 <async-reply timeout="1000000">
                     <inbound-endpoint ref="LoanBrokerQuotes"/>
                     <custom-async-reply-router class="org.mule.example.loanbroker.routers.BankQuotesResponseAggregator"/>
                 </async-reply>
             </service>

             <!--
             The credit agency service will get the credit profile for a customer
             -->
             <service name="TheCreditAgencyService">
                 <inbound>
                     <inbound-endpoint ref="CreditAgencyIn"/>
                 </inbound>
                 <component class="org.mule.example.loanbroker.credit.DefaultCreditAgency"/>
             </service>

             <!--
             The Lender service is used to determine which banks to contact for a quote
             -->
             <service name="TheLenderService">
                 <inbound>
                     <inbound-endpoint ref="LenderService"/>
                 </inbound>
                 <component class="org.mule.example.loanbroker.lender.DefaultLender"/>
                 <outbound>
                     <pass-through-router>
                         <outbound-endpoint ref="BankGateway"/>
                     </pass-through-router>
                 </outbound>
             </service>

             <service name="TheBankGateway">
                 <inbound>
                     <inbound-endpoint ref="BankGateway"/>
                     <forwarding-router/>
                 </inbound>
                 <outbound>
                     <expression-recipient-list-router evaluator="groovy" expression="payload.lenders.endpoint">
                         <reply-to address="LoanBrokerQuotes"/>
                         <expression-filter expression="payload.lenders.endpoint!=null" evaluator="groovy"/>
                     </expression-recipient-list-router>
                     <logging-catch-all-strategy/>                     
                 </outbound>
             </service>

             <!--
             These are mock bank services that represent remote bank loan services
             One or more of these are selected by the LenderService and a request
             is routed to them.   The lenderService outbound router also defines a
             replyTo property which will be used by Mule to route the responses back
             to the LoanBrokerQuotes destination
             -->
             <service name="TheBank1">
                 <inbound>
                     <inbound-endpoint ref="Bank1In"/>
                 </inbound>
                 <component class="org.mule.example.loanbroker.bank.Bank"/>
             </service>

             <service name="TheBank2">
                 <inbound>
                     <inbound-endpoint ref="Bank2In"/>
                 </inbound>
                 <component class="org.mule.example.loanbroker.bank.Bank"/>
             </service>

             <service name="TheBank3">
                 <inbound>
                     <inbound-endpoint ref="Bank3In"/>
                 </inbound>
                 <component class="org.mule.example.loanbroker.bank.Bank"/>
             </service>

             <service name="TheBank4">
                 <inbound>
                     <inbound-endpoint ref="Bank4In"/>
                 </inbound>
                 <component class="org.mule.example.loanbroker.bank.Bank"/>
             </service>

             <service name="TheBank5">
                 <inbound>
                     <inbound-endpoint ref="Bank5In"/>
                 </inbound>
                 <component class="org.mule.example.loanbroker.bank.Bank"/>
             </service>

         </model>
</mule>




© 2015 - 2025 Weber Informatics LLC | Privacy Policy