zoukankan      html  css  js  c++  java
  • Mule自带例子之loanbroker-simple

    1 配置效果图

    2 配置文件

      1 <?xml version="1.0" encoding="UTF-8"?>
      2 
      3 <mule xmlns:cxf="http://www.mulesoft.org/schema/mule/cxf" xmlns:http="http://www.mulesoft.org/schema/mule/http" version="CE-3.4.0"
      4     xmlns="http://www.mulesoft.org/schema/mule/core" 
      5     xmlns:doc="http://www.mulesoft.org/schema/mule/documentation" 
      6     xmlns:spring="http://www.springframework.org/schema/beans" 
      7     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      8     xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd
      9 http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
     10 http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
     11 http://www.mulesoft.org/schema/mule/cxf http://www.mulesoft.org/schema/mule/cxf/current/mule-cxf.xsd">
     12    
     13    <!--  
     14     The main loanbroker flow that:
     15             i) Receives a customer request
     16             ii) Performs a lookup of the customer credit profile using a component binding
     17             iii) Determines the bank that should be used to request quotes
     18             iv) Sends the request to the selected banks and aggregates responses
     19             v) Selects the lowest quote from the list of quotes
     20             vi) Returns the response to the client
     21         -->
     22     <flow name="loadbroker-sync">
     23     
     24         <http:inbound-endpoint exchange-pattern="request-response" address="http://0.0.0.0:11081" doc:name="HTTP"/>
     25         
     26         <http:body-to-parameter-map-transformer doc:name="Body to Parameter Map"/>
     27         
     28         <choice doc:name="Choice">
     29             <when expression="!(payload['name'] == null || payload['ssn'] == null || payload['amount'] == null || payload['term']==null)">
     30                 <expression-component doc:name="create customer request">
     31                 <![CDATA[
     32                     import org.mule.example.loanbroker.message.CustomerQuoteRequest;
     33                     import org.mule.example.loanbroker.model.Customer;
     34                     
     35                     payload = new CustomerQuoteRequest(
     36                             new Customer(payload['name'], Integer.parseInt(payload['ssn'])),
     37                             Integer.parseInt(payload['amount']),
     38                             Integer.parseInt(payload['term'])
     39                             );
     40                 ]]>    
     41                 </expression-component>
     42                 
     43 
     44                 <enricher source="#[payload]" target="flowVars['creditProfile']" doc:name="Enricher with creditProfile">
     45                     <!-- 
     46                     功能: 根据CustomerQuoteRequest中的Customer,调用CreditAgencyService服务,取得该客户的信用信息CreditProfile
     47                     输入payload类型:CustomerQuoteRequest
     48                     返回消息负载类型:CreditProfile - 放入流变量creditProfile中
     49                      -->
     50                     <flow-ref name="lookupCustomerCreditProfile" doc:name="lookupCustomerCreditProfile"/>
     51                 </enricher>
     52                 
     53                 <enricher source="#[payload]" target="#[flowVars['bankURIs']]" doc:name="Enricher with banks">
     54                     <!-- 
     55                     功能:根据CustomerQuoteRequest中的loanAmount,
     56                     输入消息负载类型:CustomerQuoteRequest
     57                     返回消息负载类型:数组
     58                      -->
     59                     <flow-ref name="lookupBanks" doc:name="lookupBanks"/>
     60                 </enricher>
     61                 
     62                 <set-variable variableName="quotes" value="#[new java.util.LinkedList()]" doc:name="create empty quotes"/>
     63                 
     64                 <!-- 迭代bankURIs(ArrayList)数组  -->
     65                 <foreach collection="#[flowVars['bankURIs']]" doc:name="Foreach">
     66                     <logger message="bankURI: #[payload]" level="INFO" doc:name="Test"/>
     67                     <enricher target="#[quotes.add($)]" doc:name="Message Enricher">
     68                         <!-- 
     69                         输入消息负载类型是:http://localhost:10080/mule/TheBank1
     70                         返回类型是:LoanQuote - Bank #1, rate: 6.159007229611378
     71                         把当前返回的LoanQuote放到quotes列表中
     72                          -->
     73                         <flow-ref name="lookupLoanQuote" doc:name="lookupLoanQuote"/>
     74                     </enricher>
     75                 </foreach>
     76                 <!-- 
     77                     输入消息负载类型:CustomerQuoteRequest
     78                     返回消息负载类型:为利率最低的那个LoanQuote
     79                  -->
     80                 <flow-ref name="findLowestLoanQuote" doc:name="findLowestLoanQuote"/>
     81                 <object-to-string-transformer doc:name="Object to String"/>
     82             </when>
     83             <otherwise>
     84                 <expression-component doc:name="Expression"><![CDATA[payload = 'Error: incomplete request']]></expression-component>
     85             </otherwise>
     86         </choice>
     87         <catch-exception-strategy doc:name="Catch Exception Strategy">
     88             <set-payload value="Error processing loan request" doc:name="Set error message"/>
     89         </catch-exception-strategy>       
     90     </flow>
     91     
     92     <sub-flow name="lookupCustomerCreditProfile">
     93         <!-- lookupCustomerCreditProfile input: org.mule.example.loanbroker.message.CustomerQuoteRequest@16d9b56 -->
     94         <logger message="lookupCustomerCreditProfile input: #[payload]" level="INFO" doc:name="input"/>
     95         
     96         <set-payload value="#[payload.customer]" doc:name="customer"/>
     97         <processor-chain doc:name="Processor Chain">
     98             <cxf:jaxws-client operation="getCreditProfile" serviceClass="org.mule.example.loanbroker.creditagency.CreditAgencyService" doc:name="CXF"/>
     99             <http:outbound-endpoint exchange-pattern="request-response" host="localhost" port="18080" path="mule/TheCreditAgencyService" method="POST" doc:name="HTTP"/>
    100         </processor-chain>
    101 
    102         <!-- lookupCustomerCreditProfile end payload type: creditScore: 300, creditHistory: 1  - CreditProfile -->
    103         <logger message="lookupCustomerCreditProfile output: #[payload.getClass()] - #[payload]" level="INFO" doc:name="output"/>
    104     </sub-flow>
    105     
    106     
    107     <!-- 取得Bank的URIs -->
    108     <sub-flow name="lookupBanks">
    109         <logger message="Banks to contact beginning: #[payload]" level="INFO" doc:name="banks"/>
    110         <choice doc:name="Choice">
    111             <when expression="payload.getLoanAmount() &gt;= 20000">
    112                 <expression-component doc:name="Bank1, Bank2">
    113                     <![CDATA[payload = [
    114                         new java.net.URI('http://localhost:10080/mule/TheBank1'),
    115                         new java.net.URI('http://localhost:20080/mule/TheBank2')
    116                     ]]]>
    117                 </expression-component>
    118             </when>
    119             <when expression="payload.getLoanAmount() &gt;= 10000 &amp;&amp; payload.getLoanAmount()  &lt;= 1999">
    120                 <expression-component doc:name="Bank3, Bank4">
    121                     <![CDATA[payload = [
    122                         new java.net.URI('http://localhost:30080/mule/TheBank3'),
    123                         new java.net.URI('http://localhost:40080/mule/TheBank4')
    124                     ]]]>
    125                 </expression-component>
    126             </when>
    127             <otherwise>
    128                 <expression-component doc:name="Bank5">
    129                     <![CDATA[payload = [
    130                         new java.net.URI('http://localhost:50080/mule/TheBank5')
    131                     ]]]>
    132                 </expression-component>
    133             </otherwise>
    134         </choice>
    135         <!-- 
    136                 出去时payload的类型 一个数组(lookupBanks ouput: class java.util.ArrayList)
    137         Banks to contact: [http://localhost:10080/mule/TheBank1, http://localhost:20080/mule/TheBank2]
    138          -->
    139         <logger message="lookupBanks ouput: #[payload.getClass()] - #[payload]" level="INFO" doc:name="output"/>
    140     </sub-flow>
    141     
    142     
    143     <sub-flow name="lookupLoanQuote">
    144         <!-- 
    145         lookupLoanQuote input: class java.net.URI - http://localhost:10080/mule/TheBank1 输入的类型是一个java.net.URI
    146          -->
    147         <logger message="lookupLoanQuote input: #[payload.getClass()] - #[payload]" level="INFO" doc:name="input"/>
    148         
    149         <set-variable variableName="bankUri" value="#[payload]" doc:name="bankUri"/>
    150 
    151         <expression-component doc:name="create LoanBrokerLoanRequest">
    152             <![CDATA[
    153             import org.mule.example.loanbroker.message.LoanBrokerQuoteRequest;
    154             
    155             LoanBrokerQuoteRequest bqr = new LoanBrokerQuoteRequest();
    156             bqr.setCreditProfile(flowVars['creditProfile']);
    157             payload = (Object) bqr; //此次表明,payload就是一个Object类型的引用,所以进来是引用的是java.net.URI,出去时引用的是LoanBrokerQuoteRequest
    158             ]]>
    159         </expression-component>
    160         <processor-chain doc:name="Processor Chain">
    161             <cxf:jaxws-client operation="getLoanQuote" serviceClass="org.mule.example.loanbroker.bank.BankService" doc:name="getLoanQuote"/>
    162             <http:outbound-endpoint exchange-pattern="request-response" 
    163                 address="http://#[flowVars['bankUri'].getHost()]:#[flowVars['bankUri'].getPort()]#[flowVars['bankUri'].getPath()]" doc:name="HTTP"/>
    164         </processor-chain>
    165         <logger message="LoanQuote from #[flowVars['bankUri']]: #[payload]" level="INFO" doc:name="quote"/>
    166         <logger message="lookupLoanQuote output: #[payload.getClass()] - #[payload]" level="INFO" doc:name="output"/>
    167     </sub-flow>
    168     
    169     <sub-flow name="findLowestLoanQuote">
    170         <logger message="findLowestLoanQuote input: #[payload]" level="INFO" doc:name="input"/>
    171         <expression-component doc:name="Expression">
    172             <![CDATA[
    173             import org.mule.example.loanbroker.model.LoanQuote;
    174     
    175             LoanQuote lowestQuote = null;
    176             
    177             for (Object current : (List) flowVars['quotes'])
    178             {
    179                 LoanQuote loanQuote = (LoanQuote) current;
    180                 
    181                 if (lowestQuote == null)
    182                     lowestQuote = loanQuote;
    183                 else if (loanQuote.getInterestRate() < lowestQuote.getInterestRate())
    184                     lowestQuote = loanQuote;
    185             }
    186             
    187             payload = lowestQuote;
    188             ]]>
    189         </expression-component>
    190         <logger message="findLowestLoanQuote output: #[payload.getClass()] - #[payload]" level="INFO" doc:name="output" />
    191     </sub-flow>
    192     
    193     
    194     
    195     <!-- 
    196         模拟的一些服务 
    197     -->
    198     <flow name="TheCreditAgencyService">
    199         <http:inbound-endpoint exchange-pattern="request-response"   address="http://localhost:18080/mule/TheCreditAgencyService" doc:name="HTTP"/>
    200         <cxf:jaxws-service serviceClass="org.mule.example.loanbroker.creditagency.CreditAgencyService" doc:name="SOAP"/>
    201         <component doc:name="Java">
    202             <singleton-object class="org.mule.example.loanbroker.creditagency.DefaultCreditAgency"/>
    203         </component>
    204     </flow>
    205     
    206     
    207     <flow name="Bank1Flow">
    208         <http:inbound-endpoint exchange-pattern="request-response" address="http://localhost:10080/mule/TheBank1" doc:name="HTTP"/>
    209         <cxf:jaxws-service serviceClass="org.mule.example.loanbroker.bank.BankService" doc:name="SOAP"/>
    210         <component doc:name="Bank1">
    211             <singleton-object class="org.mule.example.loanbroker.bank.Bank">
    212                 <property key="bankName" value="Bank #1" />
    213             </singleton-object>
    214         </component>
    215     </flow>
    216 
    217     <flow name="Bank2Flow">
    218         <http:inbound-endpoint exchange-pattern="request-response" address="http://localhost:20080/mule/TheBank2" doc:name="HTTP"/>
    219         <cxf:jaxws-service serviceClass="org.mule.example.loanbroker.bank.BankService" doc:name="SOAP"/>
    220         <component doc:name="Bank2">
    221             <singleton-object class="org.mule.example.loanbroker.bank.Bank">
    222                 <property key="bankName" value="Bank #2" />
    223             </singleton-object>
    224         </component>
    225     </flow>
    226     
    227     <flow name="Bank3Flow">
    228         <http:inbound-endpoint exchange-pattern="request-response" address="http://localhost:30080/mule/TheBank3" doc:name="HTTP"/>
    229         <cxf:jaxws-service serviceClass="org.mule.example.loanbroker.bank.BankService" doc:name="SOAP"/>
    230         <component doc:name="Bank3">
    231             <singleton-object class="org.mule.example.loanbroker.bank.Bank">
    232                 <property key="bankName" value="Bank #3" />
    233             </singleton-object>
    234         </component>
    235     </flow>
    236 
    237     <flow name="Bank4Flow">
    238         <http:inbound-endpoint exchange-pattern="request-response" address="http://localhost:40080/mule/TheBank4" doc:name="HTTP"/>
    239         <cxf:jaxws-service serviceClass="org.mule.example.loanbroker.bank.BankService" doc:name="SOAP"/>
    240         <component doc:name="Bank4">
    241             <singleton-object class="org.mule.example.loanbroker.bank.Bank">
    242                 <property key="bankName" value="Bank #4" />
    243             </singleton-object>
    244         </component>
    245     </flow>
    246 
    247     <flow name="Bank5Flow">
    248         <http:inbound-endpoint exchange-pattern="request-response" address="http://localhost:50080/mule/TheBank5" doc:name="HTTP"/>
    249         <cxf:jaxws-service serviceClass="org.mule.example.loanbroker.bank.BankService" doc:name="SOAP"/>
    250         <component doc:name="Bank5">
    251             <singleton-object class="org.mule.example.loanbroker.bank.Bank">
    252                 <property key="bankName" value="Bank #5" />
    253             </singleton-object>
    254         </component>
    255     </flow>
    256 </mule>

    3 相关类文件

    1)http://0.0.0.0:11081入站端点请求处理相关类 CustomerQuoteRequest和Customer

    CustomerQuoteRequest类

     1 package org.mule.example.loanbroker.message;
     2 
     3 import java.io.Serializable;
     4 
     5 import org.mule.example.loanbroker.model.Customer;
     6 
     7 public class CustomerQuoteRequest implements Serializable {
     8 
     9     /**
    10      * 
    11      */
    12     private static final long serialVersionUID = 2449671876064808042L;
    13     
    14     
    15     private Customer customer;
    16     private double loanAmount;
    17     private int loanDuration;
    18     
    19     public CustomerQuoteRequest() {}
    20     
    21     public CustomerQuoteRequest(Customer customer, double loanAmount, int loanDuration) {
    22         this.customer = customer;
    23         this.loanAmount = loanAmount;
    24         this.loanDuration = loanDuration;
    25     }
    26 
    27     
    28     public Customer getCustomer() {
    29         return customer;
    30     }
    31 
    32     public void setCustomer(Customer customer) {
    33         this.customer = customer;
    34     }
    35 
    36     public double getLoanAmount() {
    37         return loanAmount;
    38     }
    39 
    40     public void setLoanAmount(double loanAmount) {
    41         this.loanAmount = loanAmount;
    42     }
    43 
    44     public int getLoanDuration() {
    45         return loanDuration;
    46     }
    47 
    48     public void setLoanDuration(int loanDuration) {
    49         this.loanDuration = loanDuration;
    50     }
    51 }

    Customer

     1 package org.mule.example.loanbroker.model;
     2 
     3 import java.io.Serializable;
     4 
     5 public class Customer implements Serializable {
     6 
     7     /**
     8      * 
     9      */
    10     private static final long serialVersionUID = 3102974874591789911L;
    11     
    12     
    13     private String name;
    14     private int ssn;
    15     
    16     public Customer() {}
    17     
    18     public Customer(String name, int ssn) {
    19         this.name = name;
    20         this.ssn = ssn;
    21     }
    22 
    23     public String getName() {
    24         return name;
    25     }
    26 
    27     public void setName(String name) {
    28         this.name = name;
    29     }
    30 
    31     public int getSsn() {
    32         return ssn;
    33     }
    34 
    35     public void setSsn(int ssn) {
    36         this.ssn = ssn;
    37     }
    38 }

    2)http://localhost:18080/mule/TheCreditAgencyService 端点的 信用代理服务相关类 CreditAgencyService, DefaultCreditAgency 和 CreditProfile

    CreditAgencyService

     1 package org.mule.example.loanbroker.creditagency;
     2 
     3 import javax.jws.WebService;
     4 
     5 import org.mule.example.loanbroker.model.CreditProfile;
     6 import org.mule.example.loanbroker.model.Customer;
     7 
     8 /**
     9  *  该服务为客户提供信用查询
    10  *
    11  */
    12 @WebService
    13 public interface CreditAgencyService {
    14     
    15     CreditProfile getCreditProfile(Customer customer);
    16 }

    DefaultCreditAgency 

     1 package org.mule.example.loanbroker.creditagency;
     2 
     3 import org.apache.commons.logging.Log;
     4 import org.apache.commons.logging.LogFactory;
     5 import org.mule.example.loanbroker.model.CreditProfile;
     6 import org.mule.example.loanbroker.model.Customer;
     7 
     8 public class DefaultCreditAgency implements CreditAgencyService {
     9     
    10     private static final Log logger = LogFactory.getLog(DefaultCreditAgency.class);
    11 
    12     @Override
    13     public CreditProfile getCreditProfile(Customer customer) {
    14         
    15         CreditProfile cp = new CreditProfile();
    16         cp.setCreditHistory(getCreditHistoryLength(customer.getSsn()));
    17         cp.setCreditScore(getCreditScore(customer.getSsn()));
    18         return cp;
    19     }
    20     
    21     
    22     
    23     /**
    24      *  随机生成一个信用历史时间
    25      * @param ssn
    26      * @return
    27      */
    28     protected int getCreditHistoryLength(int ssn) {
    29         
    30         int credit_history_length;
    31         credit_history_length = (int) Math.random() * 19 + 1;
    32         return credit_history_length;
    33     }
    34     
    35     
    36     /**
    37      *  随机生成一个信用评分
    38      * @param ssn
    39      * @return
    40      */
    41     protected int getCreditScore(int ssn) {
    42         int credit_score;
    43         double rand = Math.random();
    44         credit_score = (int) (rand * 600 + 300);
    45         logger.info("----------------- " + "ssn[" + ssn + "]" + " 信用计算---------------------");
    46         logger.info(String.format("%.2f", rand) + " * 600 + 300 = " + credit_score);
    47         
    48         return credit_score;
    49     }
    50 }

    CreditProfile

     1 package org.mule.example.loanbroker.model;
     2 
     3 import java.io.Serializable;
     4 
     5 public class CreditProfile implements Serializable {
     6 
     7     /**
     8      * 
     9      */
    10     private static final long serialVersionUID = -875718927687611982L;
    11     
    12     
    13     private int creditScore;
    14     private int creditHistory;
    15     
    16     public CreditProfile() {}
    17     
    18     public CreditProfile(int creditScore, int creditHistory) {
    19         this.creditScore = creditScore;
    20         this.creditHistory = creditHistory;
    21     }
    22 
    23     public int getCreditScore() {
    24         return creditScore;
    25     }
    26 
    27     public void setCreditScore(int creditScore) {
    28         this.creditScore = creditScore;
    29     }
    30 
    31     public int getCreditHistory() {
    32         return creditHistory;
    33     }
    34 
    35     public void setCreditHistory(int creditHistory) {
    36         this.creditHistory = creditHistory;
    37     }
    38 
    39     public String toString() {
    40         return "creditScore: " + creditScore + ", creditHistory: " + creditHistory;
    41     }
    42     
    43 }

    5)在http://localhost:10080/mule/TheBank1, http://localhost:20080/mule/TheBank2, ...., http://localhost:50080/mule/TheBank5端点 提供 银行贷款服务的相关类

    BankService

     1 package org.mule.example.loanbroker.bank;
     2 
     3 import javax.jws.WebService;
     4 
     5 import org.mule.example.loanbroker.message.LoanBrokerQuoteRequest;
     6 import org.mule.example.loanbroker.model.LoanQuote;
     7 
     8 
     9 @WebService
    10 public interface BankService {
    11     
    12     LoanQuote getLoanQuote(LoanBrokerQuoteRequest request);
    13 
    14 }

    Bank

     1 package org.mule.example.loanbroker.bank;
     2 
     3 import java.io.Serializable;
     4 import java.util.Arrays;
     5 
     6 import org.apache.commons.logging.Log;
     7 import org.apache.commons.logging.LogFactory;
     8 import org.mule.example.loanbroker.message.LoanBrokerQuoteRequest;
     9 import org.mule.example.loanbroker.model.LoanQuote;
    10 
    11 /**
    12  * 功能描述:
    13  *     每个银行对客户分3级:
    14  *         铂金用户(信用评分:700 ~ xxx) -- 利率最低
    15  *         黄金用户(信用评分:500 ~ 700)-- 
    16  *         基本用户(信用评分:    0 ~ 500) -- 利率最高
    17  */
    18 public class Bank implements Serializable, BankService {
    19 
    20     private static final long serialVersionUID = 3581465484941524150L;
    21     
    22     private static final int PLATINUM_PROFILE_INDEX = 0;
    23     private static final int GOLD_PROFILE_INDEX = 1;
    24     private static final int BASIC_PROFILE_INDEX = 2;
    25     
    26     protected static final Log  logger = LogFactory.getLog(Bank.class);
    27     
    28     private String bankName;
    29     private final double[] rates;
    30     
    31     public Bank() {
    32         rates = new double[] {
    33                     Math.random() * 10,
    34                     Math.random() * 10,
    35                     Math.random() * 10 };
    36         Arrays.sort(rates);
    37     }
    38 
    39     @Override
    40     public LoanQuote getLoanQuote(LoanBrokerQuoteRequest request) {
    41         
    42         logger.info("-------------------- 调用 BankService(" + bankName + ")服务 ---------------");
    43         
    44         logger.info("该行提供的利率为: " + rates[0] + ", " + rates[1] + ", " + rates[2]);
    45 
    46         LoanQuote quote = new LoanQuote();
    47         quote.setBankName(bankName);
    48         //获得信用评分
    49         int creditScore = request.getCreditProfile().getCreditScore();
    50         logger.info("此次请求的信用评分creditScore:" + creditScore);    
    51         
    52         quote.setInterestRate(getCreditScoreRate(creditScore));
    53         logger.info("Returning Rate is: " + quote);
    54         logger.info("-------------------------------------------------------------");
    55         
    56         return quote;
    57     }
    58     
    59     
    60     /**
    61      * 依据信用评分判断出贷款利率
    62      * @param creditScore
    63      * @return
    64      */
    65     private double getCreditScoreRate(int creditScore) {
    66         int index;
    67         if (creditScore < 500) {
    68             index = BASIC_PROFILE_INDEX;
    69             logger.info("为基本客户");
    70         }        
    71         else if (creditScore < 700) {
    72             index = GOLD_PROFILE_INDEX;
    73             logger.info("为黄金客户");
    74         }
    75             
    76         else {
    77             index = PLATINUM_PROFILE_INDEX;
    78             logger.info("为铂金客户");
    79         }    
    80         
    81         return rates[index];
    82     }
    83 
    84     public String getBankName() {
    85         return bankName;
    86     }
    87 
    88     public void setBankName(String bankName) {
    89         this.bankName = bankName;
    90     }
    91 }

    LoanQuote

     1 package org.mule.example.loanbroker.model;
     2 
     3 import java.io.Serializable;
     4 
     5 public class LoanQuote implements Serializable {
     6 
     7     /**
     8      * 
     9      */
    10     private static final long serialVersionUID = -6113408134263802670L;
    11     
    12     
    13     private String bankName;
    14     private double interestRate = 0;
    15     
    16     
    17     public LoanQuote() {}
    18 
    19 
    20     public String getBankName() {
    21         return bankName;
    22     }
    23 
    24 
    25     public void setBankName(String bankName) {
    26         this.bankName = bankName;
    27     }
    28 
    29 
    30     public double getInterestRate() {
    31         return interestRate;
    32     }
    33 
    34 
    35     public void setInterestRate(double interestRate) {
    36         this.interestRate = interestRate;
    37     }
    38     
    39     
    40     public String toString() {
    41         return bankName + ", rate: " + interestRate;
    42     }
    43 }

    4 测试

    5 输出日志分析

    [06-23 12:05:43] INFO  DefaultMuleApplication [main]: 
    ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    + Initializing app 'loanbroker-simple'                     +
    ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    [06-23 12:05:43] INFO  AbstractLifecycleManager [main]: Initialising RegistryBroker 初始化注册代理
    [06-23 12:05:44] INFO  MuleApplicationContext [main]: Refreshing org.mule.config.spring.MuleApplicationContext@e28886: startup date [Tue Jun 23 12:05:44 CST 2015]; root of context hierarchy 刷新mule应用上下文
    [06-23 12:05:45] INFO  AbstractLifecycleManager [main]: Initialising model: _muleSystemModel  初始化mule系统模型
    [06-23 12:05:45] INFO  AbstractLifecycleManager [main]: Initialising connector: connector.http.mule.default 初始化http连接器
    [06-23 12:05:46] WARN GenericTypeAwarePropertyDescriptor [main]: Invalid JavaBean property 'port' being accessed! Ambiguous write methods found next to actually used [public void org.mule.endpoint.URIBuilder.setPort(java.lang.String)]: [public void org.mule.endpoint.URIBuilder.setPort(int)]
    [06-23 12:05:46] INFO FlowConstructLifecycleManager [main]: Initialising flow: loadbroker-sync 初始化流 [06-23 12:05:46] INFO CatchMessagingExceptionStrategy [main]: Initialising exception listener: org.mule.exception.CatchMessagingExceptionStrategy@19587e5 [06-23 12:05:46] INFO SedaStageLifecycleManager [main]: Initialising service: loadbroker-sync.stage1
    [06-23 12:05:46] INFO FlowConstructLifecycleManager [main]: Initialising flow: TheCreditAgencyService [06-23 12:05:46] INFO DefaultMessagingExceptionStrategy [main]: Initialising exception listener: org.mule.exception.DefaultMessagingExceptionStrategy@4fb8ac [06-23 12:05:46] INFO SedaStageLifecycleManager [main]: Initialising service: TheCreditAgencyService.stage1 [06-23 12:05:46] INFO WebServiceFactoryBean [main]: Built CXF Inbound MessageProcessor for service class org.mule.example.loanbroker.creditagency.CreditAgencyService [06-23 12:05:46] INFO ComponentLifecycleManager [main]: Initialising component: component.8626349
    [06-23 12:05:46] INFO FlowConstructLifecycleManager [main]: Initialising flow: Bank1Flow [06-23 12:05:46] INFO DefaultMessagingExceptionStrategy [main]: Initialising exception listener: org.mule.exception.DefaultMessagingExceptionStrategy@179ff98 [06-23 12:05:46] INFO SedaStageLifecycleManager [main]: Initialising service: Bank1Flow.stage1 [06-23 12:05:46] INFO WebServiceFactoryBean [main]: Built CXF Inbound MessageProcessor for service class org.mule.example.loanbroker.bank.BankService [06-23 12:05:46] INFO ComponentLifecycleManager [main]: Initialising component: component.2709710
    [06-23 12:05:46] INFO FlowConstructLifecycleManager [main]: Initialising flow: Bank2Flow [06-23 12:05:46] INFO DefaultMessagingExceptionStrategy [main]: Initialising exception listener: org.mule.exception.DefaultMessagingExceptionStrategy@10aaafc [06-23 12:05:46] INFO SedaStageLifecycleManager [main]: Initialising service: Bank2Flow.stage1 [06-23 12:05:46] INFO WebServiceFactoryBean [main]: Built CXF Inbound MessageProcessor for service class org.mule.example.loanbroker.bank.BankService [06-23 12:05:46] INFO ComponentLifecycleManager [main]: Initialising component: component.18460269
    [06-23 12:05:46] INFO FlowConstructLifecycleManager [main]: Initialising flow: Bank3Flow [06-23 12:05:46] INFO DefaultMessagingExceptionStrategy [main]: Initialising exception listener: org.mule.exception.DefaultMessagingExceptionStrategy@1f0b28 [06-23 12:05:46] INFO SedaStageLifecycleManager [main]: Initialising service: Bank3Flow.stage1 [06-23 12:05:46] INFO WebServiceFactoryBean [main]: Built CXF Inbound MessageProcessor for service class org.mule.example.loanbroker.bank.BankService [06-23 12:05:46] INFO ComponentLifecycleManager [main]: Initialising component: component.25069616
    [06-23 12:05:46] INFO FlowConstructLifecycleManager [main]: Initialising flow: Bank4Flow [06-23 12:05:46] INFO DefaultMessagingExceptionStrategy [main]: Initialising exception listener: org.mule.exception.DefaultMessagingExceptionStrategy@1c2547b [06-23 12:05:46] INFO SedaStageLifecycleManager [main]: Initialising service: Bank4Flow.stage1 [06-23 12:05:46] INFO WebServiceFactoryBean [main]: Built CXF Inbound MessageProcessor for service class org.mule.example.loanbroker.bank.BankService [06-23 12:05:46] INFO ComponentLifecycleManager [main]: Initialising component: component.16222959
    [06-23 12:05:46] INFO FlowConstructLifecycleManager [main]: Initialising flow: Bank5Flow [06-23 12:05:46] INFO DefaultMessagingExceptionStrategy [main]: Initialising exception listener: org.mule.exception.DefaultMessagingExceptionStrategy@13c6aff [06-23 12:05:46] INFO SedaStageLifecycleManager [main]: Initialising service: Bank5Flow.stage1 [06-23 12:05:46] INFO WebServiceFactoryBean [main]: Built CXF Inbound MessageProcessor for service class org.mule.example.loanbroker.bank.BankService [06-23 12:05:46] INFO ComponentLifecycleManager [main]: Initialising component: component.24429866

    [06-23 12:05:46] INFO AutoConfigurationBuilder [main]: Configured Mule using "org.mule.config.spring.SpringXmlConfigurationBuilder" with configuration resource(s): "[ConfigResource{resourceName='D:AnypointStudioworkspace.muleappsloanbroker-simpleloanbroker-simple.xml'}]" [06-23 12:05:46] INFO AutoConfigurationBuilder [main]: Configured Mule using "org.mule.config.builders.AutoConfigurationBuilder" with configuration resource(s): "[ConfigResource{resourceName='D:AnypointStudioworkspace.muleappsloanbroker-simpleloanbroker-simple.xml'}]" [06-23 12:05:46] INFO DefaultMuleApplication [main]: Monitoring for hot-deployment: D:AnypointStudioworkspace.muleappsloanbroker-simpleloanbroker-simple.xml [06-23 12:05:46] INFO DefaultMuleApplication [main]: ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + Starting app 'loanbroker-simple' + ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ [06-23 12:05:46] INFO TransactionalQueueManager [main]: Starting ResourceManager [06-23 12:05:46] INFO TransactionalQueueManager [main]: Started ResourceManager [06-23 12:05:46] INFO HttpConnector [main]: Connected: HttpConnector { name=connector.http.mule.default lifecycle=initialise this=4bd2df numberOfConcurrentTransactedReceivers=4 createMultipleTransactedReceivers=true connected=true supportedProtocols=[http] serviceOverrides=
    <none> } [06-23 12:05:46] INFO HttpConnector [main]: Starting: HttpConnector { name=connector.http.mule.default lifecycle=initialise this=4bd2df numberOfConcurrentTransactedReceivers=4 createMultipleTransactedReceivers=true connected=true supportedProtocols=[http] serviceOverrides=<none> } [06-23 12:05:46] INFO AbstractLifecycleManager [main]: Starting connector: connector.http.mule.default 启动http连接器 [06-23 12:05:46] INFO AbstractLifecycleManager [main]: Starting model: _muleSystemModel 启动mule系统模型

    启动流服务loadbroker-sync [06-23 12:05:46] INFO FlowConstructLifecycleManager [main]: Starting flow: loadbroker-sync [06-23 12:05:46] INFO SedaStageLifecycleManager [main]: Starting service: loadbroker-sync.stage1 [06-23 12:05:46] INFO HttpConnector [main]: Registering listener: loadbroker-sync on endpointUri: http://0.0.0.0:11081 [06-23 12:05:46] INFO DefaultTransportServiceDescriptor [main]: Loading default response transformer: org.mule.transport.http.transformers.MuleMessageToHttpResponse [06-23 12:05:46] INFO AbstractLifecycleManager [main]: Initialising: 'null'. Object is: HttpMessageReceiver HTTP消息接收者没有名字,初始化名字为'null'的HTTP消息接受者 [06-23 12:05:46] INFO HttpMessageReceiver [main]: Connecting clusterizable message receiver [06-23 12:05:46] INFO AbstractLifecycleManager [main]: Starting: 'null'. Object is: HttpMessageReceiver 启动名字为'null'的HTTP消息接收者 [06-23 12:05:46] INFO HttpMessageReceiver [main]: Starting clusterizable message receiver

    启动流服务TheCreditAgencyService [06-23 12:05:46] INFO FlowConstructLifecycleManager [main]: Starting flow: TheCreditAgencyService [06-23 12:05:46] INFO SedaStageLifecycleManager [main]: Starting service: TheCreditAgencyService.stage1 [06-23 12:05:46] INFO ComponentLifecycleManager [main]: Starting component: component.8626349 [06-23 12:05:46] INFO HttpConnector [main]: Registering listener: TheCreditAgencyService on endpointUri: http://localhost:18080/mule/TheCreditAgencyService [06-23 12:05:46] INFO DefaultTransportServiceDescriptor [main]: Loading default response transformer: org.mule.transport.http.transformers.MuleMessageToHttpResponse [06-23 12:05:46] INFO AbstractLifecycleManager [main]: Initialising: 'null'. Object is: HttpMessageReceiver [06-23 12:05:46] INFO HttpMessageReceiver [main]: Connecting clusterizable message receiver [06-23 12:05:46] INFO AbstractLifecycleManager [main]: Starting: 'null'. Object is: HttpMessageReceiver [06-23 12:05:46] INFO HttpMessageReceiver [main]: Starting clusterizable message receiver

    启动流服务Bank1Flow [06-23 12:05:46] INFO FlowConstructLifecycleManager [main]: Starting flow: Bank1Flow [06-23 12:05:46] INFO SedaStageLifecycleManager [main]: Starting service: Bank1Flow.stage1 [06-23 12:05:46] INFO ComponentLifecycleManager [main]: Starting component: component.2709710 [06-23 12:05:46] INFO HttpConnector [main]: Registering listener: Bank1Flow on endpointUri: http://localhost:10080/mule/TheBank1 [06-23 12:05:46] INFO DefaultTransportServiceDescriptor [main]: Loading default response transformer: org.mule.transport.http.transformers.MuleMessageToHttpResponse [06-23 12:05:46] INFO AbstractLifecycleManager [main]: Initialising: 'null'. Object is: HttpMessageReceiver [06-23 12:05:46] INFO HttpMessageReceiver [main]: Connecting clusterizable message receiver [06-23 12:05:46] INFO AbstractLifecycleManager [main]: Starting: 'null'. Object is: HttpMessageReceiver [06-23 12:05:46] INFO HttpMessageReceiver [main]: Starting clusterizable message receiver

    [06-23 12:05:46] INFO FlowConstructLifecycleManager [main]: Starting flow: Bank2Flow [06-23 12:05:46] INFO SedaStageLifecycleManager [main]: Starting service: Bank2Flow.stage1 [06-23 12:05:46] INFO ComponentLifecycleManager [main]: Starting component: component.18460269 [06-23 12:05:46] INFO HttpConnector [main]: Registering listener: Bank2Flow on endpointUri: http://localhost:20080/mule/TheBank2 [06-23 12:05:46] INFO DefaultTransportServiceDescriptor [main]: Loading default response transformer: org.mule.transport.http.transformers.MuleMessageToHttpResponse [06-23 12:05:46] INFO AbstractLifecycleManager [main]: Initialising: 'null'. Object is: HttpMessageReceiver [06-23 12:05:46] INFO HttpMessageReceiver [main]: Connecting clusterizable message receiver [06-23 12:05:46] INFO AbstractLifecycleManager [main]: Starting: 'null'. Object is: HttpMessageReceiver [06-23 12:05:46] INFO HttpMessageReceiver [main]: Starting clusterizable message receiver [06-23 12:05:46] INFO FlowConstructLifecycleManager [main]: Starting flow: Bank3Flow [06-23 12:05:46] INFO SedaStageLifecycleManager [main]: Starting service: Bank3Flow.stage1 [06-23 12:05:46] INFO ComponentLifecycleManager [main]: Starting component: component.25069616 [06-23 12:05:46] INFO HttpConnector [main]: Registering listener: Bank3Flow on endpointUri: http://localhost:30080/mule/TheBank3 [06-23 12:05:46] INFO DefaultTransportServiceDescriptor [main]: Loading default response transformer: org.mule.transport.http.transformers.MuleMessageToHttpResponse [06-23 12:05:46] INFO AbstractLifecycleManager [main]: Initialising: 'null'. Object is: HttpMessageReceiver [06-23 12:05:46] INFO HttpMessageReceiver [main]: Connecting clusterizable message receiver [06-23 12:05:46] INFO AbstractLifecycleManager [main]: Starting: 'null'. Object is: HttpMessageReceiver [06-23 12:05:46] INFO HttpMessageReceiver [main]: Starting clusterizable message receiver [06-23 12:05:46] INFO FlowConstructLifecycleManager [main]: Starting flow: Bank4Flow [06-23 12:05:46] INFO SedaStageLifecycleManager [main]: Starting service: Bank4Flow.stage1 [06-23 12:05:46] INFO ComponentLifecycleManager [main]: Starting component: component.16222959 [06-23 12:05:46] INFO HttpConnector [main]: Registering listener: Bank4Flow on endpointUri: http://localhost:40080/mule/TheBank4 [06-23 12:05:46] INFO DefaultTransportServiceDescriptor [main]: Loading default response transformer: org.mule.transport.http.transformers.MuleMessageToHttpResponse [06-23 12:05:46] INFO AbstractLifecycleManager [main]: Initialising: 'null'. Object is: HttpMessageReceiver [06-23 12:05:46] INFO HttpMessageReceiver [main]: Connecting clusterizable message receiver [06-23 12:05:46] INFO AbstractLifecycleManager [main]: Starting: 'null'. Object is: HttpMessageReceiver [06-23 12:05:46] INFO HttpMessageReceiver [main]: Starting clusterizable message receiver [06-23 12:05:46] INFO FlowConstructLifecycleManager [main]: Starting flow: Bank5Flow [06-23 12:05:46] INFO SedaStageLifecycleManager [main]: Starting service: Bank5Flow.stage1 [06-23 12:05:46] INFO ComponentLifecycleManager [main]: Starting component: component.24429866 [06-23 12:05:46] INFO HttpConnector [main]: Registering listener: Bank5Flow on endpointUri: http://localhost:50080/mule/TheBank5 [06-23 12:05:46] INFO DefaultTransportServiceDescriptor [main]: Loading default response transformer: org.mule.transport.http.transformers.MuleMessageToHttpResponse [06-23 12:05:46] INFO AbstractLifecycleManager [main]: Initialising: 'null'. Object is: HttpMessageReceiver [06-23 12:05:46] INFO HttpMessageReceiver [main]: Connecting clusterizable message receiver [06-23 12:05:46] INFO AbstractLifecycleManager [main]: Starting: 'null'. Object is: HttpMessageReceiver [06-23 12:05:46] INFO HttpMessageReceiver [main]: Starting clusterizable message receiver

    [06-23 12:05:46] INFO DefaultMuleApplication [main]: Reload interval: 3000 [06-23 12:05:46] INFO WrapperManagerAgent [main]: This JVM hasn't been launched by the wrapper, the agent will not run.
    [06-23 12:05:46] INFO JmxAgent [main]: Attempting to register service with name: 注册流服务TheCreditAgencyService
        Mule.loanbroker-simple:type=Endpoint,service="TheCreditAgencyService",connector=connector.http.mule.default,name="endpoint.http.localhost.18080.mule.TheCreditAgencyService" [06-23 12:05:46] INFO JmxAgent [main]: Registered Endpoint Service with name:
        Mule.loanbroker-simple:type=Endpoint,service="TheCreditAgencyService",connector=connector.http.mule.default,name="endpoint.http.localhost.18080.mule.TheCreditAgencyService"
    [06-23 12:05:46] INFO JmxAgent [main]: Attempting to register service with name:
        Mule.loanbroker-simple:type=Endpoint,service="Bank3Flow",connector=connector.http.mule.default,name="endpoint.http.localhost.30080.mule.TheBank3" [06-23 12:05:46] INFO JmxAgent [main]: Registered Endpoint Service with name:
        Mule.loanbroker-simple:type=Endpoint,service="Bank3Flow",connector=connector.http.mule.default,name="endpoint.http.localhost.30080.mule.TheBank3"
    [06-23 12:05:46] INFO JmxAgent [main]: Attempting to register service with name: Mule.loanbroker-simple:type=Endpoint,service="Bank4Flow",connector=connector.http.mule.default,name="endpoint.http.localhost.40080.mule.TheBank4" [06-23 12:05:46] INFO JmxAgent [main]: Registered Endpoint Service with name: Mule.loanbroker-simple:type=Endpoint,service="Bank4Flow",connector=connector.http.mule.default,name="endpoint.http.localhost.40080.mule.TheBank4" [06-23 12:05:46] INFO JmxAgent [main]: Attempting to register service with name: Mule.loanbroker-simple:type=Endpoint,service="Bank5Flow",connector=connector.http.mule.default,name="endpoint.http.localhost.50080.mule.TheBank5" [06-23 12:05:46] INFO JmxAgent [main]: Registered Endpoint Service with name: Mule.loanbroker-simple:type=Endpoint,service="Bank5Flow",connector=connector.http.mule.default,name="endpoint.http.localhost.50080.mule.TheBank5" [06-23 12:05:46] INFO JmxAgent [main]: Attempting to register service with name: Mule.loanbroker-simple:type=Endpoint,service="Bank1Flow",connector=connector.http.mule.default,name="endpoint.http.localhost.10080.mule.TheBank1" [06-23 12:05:46] INFO JmxAgent [main]: Registered Endpoint Service with name: Mule.loanbroker-simple:type=Endpoint,service="Bank1Flow",connector=connector.http.mule.default,name="endpoint.http.localhost.10080.mule.TheBank1" [06-23 12:05:46] INFO JmxAgent [main]: Attempting to register service with name: Mule.loanbroker-simple:type=Endpoint,service="Bank2Flow",connector=connector.http.mule.default,name="endpoint.http.localhost.20080.mule.TheBank2" [06-23 12:05:46] INFO JmxAgent [main]: Registered Endpoint Service with name: Mule.loanbroker-simple:type=Endpoint,service="Bank2Flow",connector=connector.http.mule.default,name="endpoint.http.localhost.20080.mule.TheBank2"
    [06-23 12:05:46] INFO JmxAgent [main]: Attempting to register service with name: 注册流服务loadbroker-sync
        Mule.loanbroker-simple:type=Endpoint,service="loadbroker-sync",connector=connector.http.mule.default,name="endpoint.http.0.0.0.0.11081" [06-23 12:05:46] INFO JmxAgent [main]: Registered Endpoint Service with name:
      Mule.loanbroker-simple:type=Endpoint,service="loadbroker-sync",connector=connector.http.mule.default,name="endpoint.http.0.0.0.0.11081"
    [06-23 12:05:46] INFO JmxAgent [main]: Registered Connector Service with name: 注册连接器服务connector.http.mule.default.1
        Mule.loanbroker-simple:type=Connector,name="connector.http.mule.default.1"

    [06-23 12:05:46] INFO DefaultMuleContext [main]: ********************************************************************** * Application: loanbroker-simple * * OS encoding: GBK, Mule encoding: UTF-8 * * * * Agents Running: * * JMX Agent * ********************************************************************** [06-23 12:05:46] INFO MuleDeploymentService [main]: ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + Started app 'loanbroker-simple' + ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ [06-23 12:05:46] INFO StartupSummaryDeploymentListener [main]: ********************************************************************** * - - + APPLICATION + - - * - - + STATUS + - - * ********************************************************************** * loanbroker-simple * DEPLOYED * ********************************************************************** [06-23 12:05:46] INFO MuleDeploymentService [main]: ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + Mule is up and kicking (every 5000ms) + ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    [06-23 12:05:49] INFO DefaultTransportServiceDescriptor [[loanbroker-simple].connector.http.mule.default.receiver.08]: Loading default outbound transformer: org.mule.transport.http.transformers.ObjectToHttpClientMethodRequest [06-23 12:05:49] INFO DefaultTransportServiceDescriptor [[loanbroker-simple].connector.http.mule.default.receiver.08]: Loading default response transformer: org.mule.transport.http.transformers.MuleMessageToHttpResponse [06-23 12:05:49] INFO DefaultTransportServiceDescriptor [[loanbroker-simple].connector.http.mule.default.receiver.08]: Loading default outbound transformer: org.mule.transport.http.transformers.ObjectToHttpClientMethodRequest
    [06-23 12:05:49] INFO AbstractLifecycleManager [[loanbroker-simple].connector.http.mule.default.receiver.08]: Initialising: 'connector.http.mule.default.dispatcher.4887456'. Object is: HttpClientMessageDispatcher [06-23 12:05:49] INFO AbstractLifecycleManager [[loanbroker-simple].connector.http.mule.default.receiver.08]: Starting: 'connector.http.mule.default.dispatcher.4887456'. Object is: HttpClientMessageDispatcher

    调用子流lookupCustomerCreditProfile的日志输出
    [06-23 12:05:49] INFO  LoggerMessageProcessor [[loanbroker-simple].connector.http.mule.default.receiver.08]: lookupCustomerCreditProfile input: org.mule.example.loanbroker.message.CustomerQuoteRequest@e9c2fd [06-23 12:05:49] INFO DefaultCreditAgency [[loanbroker-simple].connector.http.mule.default.receiver.09]: ----------------- ssn[1234] 信用计算--------------------- [06-23 12:05:49] INFO DefaultCreditAgency [[loanbroker-simple].connector.http.mule.default.receiver.09]: 0.51 * 600 + 300 = 607 [06-23 12:05:49] INFO LoggerMessageProcessor [[loanbroker-simple].connector.http.mule.default.receiver.08]: lookupCustomerCreditProfile output: class org.mule.example.loanbroker.model.CreditProfile - creditScore: 607, creditHistory: 1

    调用子流lookupBanks的日志输出 [06-23 12:05:49] INFO LoggerMessageProcessor [[loanbroker-simple].connector.http.mule.default.receiver.08]: Banks to contact beginning: org.mule.example.loanbroker.message.CustomerQuoteRequest@e9c2fd [06-23 12:05:49] INFO LoggerMessageProcessor [[loanbroker-simple].connector.http.mule.default.receiver.08]: lookupBanks ouput: class java.util.ArrayList - [http://localhost:10080/mule/TheBank1, http://localhost:20080/mule/TheBank2]

    当前迭代的bankURL [06-23 12:05:49] INFO LoggerMessageProcessor [[loanbroker-simple].connector.http.mule.default.receiver.08]: bankURI: http://localhost:10080/mule/TheBank1
    以当前迭代bankURL为输入消息负载,调用子流lookupLoanQuote [06-23 12:05:49] INFO LoggerMessageProcessor [[loanbroker-simple].connector.http.mule.default.receiver.08]: lookupLoanQuote input: class java.net.URI - http://localhost:10080/mule/TheBank1 [06-23 12:05:49] INFO DefaultTransportServiceDescriptor [[loanbroker-simple].connector.http.mule.default.receiver.08]: Loading default outbound transformer: org.mule.transport.http.transformers.ObjectToHttpClientMethodRequest [06-23 12:05:49] INFO DefaultTransportServiceDescriptor [[loanbroker-simple].connector.http.mule.default.receiver.08]: Loading default response transformer: org.mule.transport.http.transformers.MuleMessageToHttpResponse [06-23 12:05:49] INFO DefaultTransportServiceDescriptor [[loanbroker-simple].connector.http.mule.default.receiver.08]: Loading default outbound transformer: org.mule.transport.http.transformers.ObjectToHttpClientMethodRequest [06-23 12:05:49] INFO AbstractLifecycleManager [[loanbroker-simple].connector.http.mule.default.receiver.08]: Initialising: 'connector.http.mule.default.dispatcher.24609463'. Object is: HttpClientMessageDispatcher [06-23 12:05:49] INFO AbstractLifecycleManager [[loanbroker-simple].connector.http.mule.default.receiver.08]: Starting: 'connector.http.mule.default.dispatcher.24609463'. Object is: HttpClientMessageDispatcher [06-23 12:05:49] INFO Bank [[loanbroker-simple].connector.http.mule.default.receiver.09]: -------------------- 调用 BankService(Bank #1)服务 --------------- [06-23 12:05:49] INFO Bank [[loanbroker-simple].connector.http.mule.default.receiver.09]: 该行提供的利率为: 1.3555978615889497, 3.120721438085554, 3.6467680827751336 [06-23 12:05:49] INFO Bank [[loanbroker-simple].connector.http.mule.default.receiver.09]: 此次请求的信用评分creditScore:607 [06-23 12:05:49] INFO Bank [[loanbroker-simple].connector.http.mule.default.receiver.09]: 为黄金客户 [06-23 12:05:49] INFO Bank [[loanbroker-simple].connector.http.mule.default.receiver.09]: Returning Rate is: Bank #1, rate: 3.120721438085554 [06-23 12:05:49] INFO Bank [[loanbroker-simple].connector.http.mule.default.receiver.09]: ------------------------------------------------------------- [06-23 12:05:49] INFO LoggerMessageProcessor [[loanbroker-simple].connector.http.mule.default.receiver.08]: LoanQuote from http://localhost:10080/mule/TheBank1: Bank #1, rate: 3.120721438085554 [06-23 12:05:49] INFO LoggerMessageProcessor [[loanbroker-simple].connector.http.mule.default.receiver.08]: lookupLoanQuote output: class org.mule.example.loanbroker.model.LoanQuote - Bank #1, rate: 3.120721438085554


    当前迭代的bankURL [06-23 12:05:49] INFO LoggerMessageProcessor [[loanbroker-simple].connector.http.mule.default.receiver.08]: bankURI: http://localhost:20080/mule/TheBank2
    以当前迭代bankURL为输入消息负载,调用子流lookupLoanQuote [06-23 12:05:49] INFO LoggerMessageProcessor [[loanbroker-simple].connector.http.mule.default.receiver.08]: lookupLoanQuote input: class java.net.URI - http://localhost:20080/mule/TheBank2 [06-23 12:05:49] INFO DefaultTransportServiceDescriptor [[loanbroker-simple].connector.http.mule.default.receiver.08]: Loading default outbound transformer: org.mule.transport.http.transformers.ObjectToHttpClientMethodRequest [06-23 12:05:49] INFO DefaultTransportServiceDescriptor [[loanbroker-simple].connector.http.mule.default.receiver.08]: Loading default response transformer: org.mule.transport.http.transformers.MuleMessageToHttpResponse [06-23 12:05:49] INFO DefaultTransportServiceDescriptor [[loanbroker-simple].connector.http.mule.default.receiver.08]: Loading default outbound transformer: org.mule.transport.http.transformers.ObjectToHttpClientMethodRequest [06-23 12:05:49] INFO AbstractLifecycleManager [[loanbroker-simple].connector.http.mule.default.receiver.08]: Initialising: 'connector.http.mule.default.dispatcher.13026502'. Object is: HttpClientMessageDispatcher [06-23 12:05:49] INFO AbstractLifecycleManager [[loanbroker-simple].connector.http.mule.default.receiver.08]: Starting: 'connector.http.mule.default.dispatcher.13026502'. Object is: HttpClientMessageDispatcher [06-23 12:05:49] INFO Bank [[loanbroker-simple].connector.http.mule.default.receiver.09]: -------------------- 调用 BankService(Bank #2)服务 --------------- [06-23 12:05:49] INFO Bank [[loanbroker-simple].connector.http.mule.default.receiver.09]: 该行提供的利率为: 4.414272738125696, 8.167077378604374, 8.318685247739264 [06-23 12:05:49] INFO Bank [[loanbroker-simple].connector.http.mule.default.receiver.09]: 此次请求的信用评分creditScore:607 [06-23 12:05:49] INFO Bank [[loanbroker-simple].connector.http.mule.default.receiver.09]: 为黄金客户 [06-23 12:05:49] INFO Bank [[loanbroker-simple].connector.http.mule.default.receiver.09]: Returning Rate is: Bank #2, rate: 8.167077378604374 [06-23 12:05:49] INFO Bank [[loanbroker-simple].connector.http.mule.default.receiver.09]: ------------------------------------------------------------- [06-23 12:05:49] INFO LoggerMessageProcessor [[loanbroker-simple].connector.http.mule.default.receiver.08]: LoanQuote from http://localhost:20080/mule/TheBank2: Bank #2, rate: 8.167077378604374 [06-23 12:05:49] INFO LoggerMessageProcessor [[loanbroker-simple].connector.http.mule.default.receiver.08]: lookupLoanQuote output: class org.mule.example.loanbroker.model.LoanQuote - Bank #2, rate: 8.167077378604374

    调用子流findLowestLoanQuote选择利率最低的LoanQuote贷款方案 [06-23 12:05:49] INFO LoggerMessageProcessor [[loanbroker-simple].connector.http.mule.default.receiver.08]: findLowestLoanQuote input: org.mule.example.loanbroker.message.CustomerQuoteRequest@e9c2fd [06-23 12:05:49] INFO LoggerMessageProcessor [[loanbroker-simple].connector.http.mule.default.receiver.08]: findLowestLoanQuote output: class org.mule.example.loanbroker.model.LoanQuote - Bank #1, rate: 3.120721438085554
  • 相关阅读:
    Pytorch-情感分类实战(基于LSTM,调用torchtext)
    Pytorch-LSTM
    Pytorch-时间序列预测
    Pytorch-RNN
    SQLServer -------- 包含(charindex)
    .NET ------ 树形菜单,点击单选按钮触发相应事件
    电子秤Xk3190-A12+E 称重方式的设置方法
    串口调试工具与com口编程
    .NET ------ Repeater 遍历数据显示在页面上
    .NET ------ 将弹窗内增加选项卡
  • 原文地址:https://www.cnblogs.com/asnjudy/p/4595162.html
Copyright © 2011-2022 走看看