camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From conflue...@apache.org
Subject [CONF] Apache Camel > Loan Broker Example
Date Wed, 18 Jul 2012 15:02:00 GMT
<html>
<head>
    <base href="https://cwiki.apache.org/confluence">
            <link rel="stylesheet" href="/confluence/s/2042/9/1/_/styles/combined.css?spaceKey=CAMEL&amp;forWysiwyg=true"
type="text/css">
    </head>
<body style="background: white;" bgcolor="white" class="email-body">
<div id="pageContent">
<div id="notificationFormat">
<div class="wiki-content">
<div class="email">
    <h2><a href="https://cwiki.apache.org/confluence/display/CAMEL/Loan+Broker+Example">Loan
Broker Example</a></h2>
    <h4>Page <b>edited</b> by             <a href="https://cwiki.apache.org/confluence/display/~njiang">willem
jiang</a>
    </h4>
        <br/>
                         <h4>Changes (1)</h4>
                                 
    
<div id="page-diffs">
                    <table class="diff" cellpadding="0" cellspacing="0">
    
            <tr><td class="diff-snipped" >...<br></td></tr>
            <tr><td class="diff-unchanged" > <br>h2. Example with web service
<br></td></tr>
            <tr><td class="diff-changed-lines" >The [web service version of loan
<span class="diff-changed-words">broker|https://svn.apache.org/repos/asf/camel/trunk/examples/camel-example-loan-broker/src/main/java/org/apache/camel/loanbroker/webservi<span
class="diff-added-chars"style="background-color: #dfd;">c</span>e/version<span
class="diff-added-chars"style="background-color: #dfd;">/</span>]</span> is
based on the camel-cxf component which can produce and consume the SOAP message on the wire.
It uses the InOut Message exchange pattern, when the client send out the message to the router
, it can get the response message back from the same endpoint. <br></td></tr>
            <tr><td class="diff-unchanged" >When we send out the quote message
to the three different banks, we could choice to call the bank service one by one or send
out the message parallelly(one request thread per request). <br>You can compare the
response time after you run the sample. <br></td></tr>
            <tr><td class="diff-snipped" >...<br></td></tr>
    
            </table>
    </div>                            <h4>Full Content</h4>
                    <div class="notificationGreySide">
        <h1><a name="LoanBrokerExample-LoanBrokerExample"></a>Loan Broker
Example</h1>

<p>This example shows how to use Camel to implement the <a href="http://www.enterpriseintegrationpatterns.com/ComposedMessagingExample.html"
class="external-link" rel="nofollow">EIP's loan broker example</a>.</p>

<p>The example has two versions,one for JMS, one for webservice one.<br/>
The JMS version which leverages the message queue to connect the credit agency and bank loan
quote processors together, it just uses the InOnly exchange pattern to handle the message
asynchronously; <br/>
the webservice version which shows how to integrate the credit agency and bank web services
together by using the InOut exchange pattern synchronously.</p>

<h2><a name="LoanBrokerExample-Examplewithmessagequeue%28JMS%29"></a>Example
with message queue (JMS)</h2>

<p>The <a href="https://svn.apache.org/repos/asf/camel/trunk/examples/camel-example-loan-broker/src/main/java/org/apache/camel/loanbroker/queue/version"
class="external-link" rel="nofollow">queue version of loan broker</a> is based on
the  camel-jms component, and it shows how to using the message queue to connect the different
service models (such as the credit agency , and banks). </p>

<p>The example should run if you type</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
mvn exec:java -PQueue.LoanBroker

mvn exec:java -PQueue.Client
</pre>
</div></div>

<p>To stop the example hit ctrl + c</p>


<h2><a name="LoanBrokerExample-Examplewithwebservice"></a>Example with web
service</h2>
<p>The <a href="https://svn.apache.org/repos/asf/camel/trunk/examples/camel-example-loan-broker/src/main/java/org/apache/camel/loanbroker/webservice/version/"
class="external-link" rel="nofollow">web service version of loan broker</a> is based
on the camel-cxf component which can produce and consume the SOAP message on the wire. It
uses the InOut Message exchange pattern, when the client send out the message to the router
, it can get the response message back from the same endpoint.<br/>
When we send out the quote message to the three different banks, we could choice to call the
bank service one by one or send out the message parallelly(one request thread per request).<br/>
You can compare the response time after you run the sample.</p>

<p>The example should run if you type</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
mvn exec:java -PWS.LoanBroker

mvn exec:java -PWS.Client
</pre>
</div></div>

<p>To stop the example hit ctrl + c</p>
    </div>
        <div id="commentsSection" class="wiki-content pageSection">
        <div style="float: right;">
            <a href="https://cwiki.apache.org/confluence/users/viewnotifications.action"
class="grey">Change Notification Preferences</a>
        </div>
        <a href="https://cwiki.apache.org/confluence/display/CAMEL/Loan+Broker+Example">View
Online</a>
        |
        <a href="https://cwiki.apache.org/confluence/pages/diffpagesbyversion.action?pageId=87687&revisedVersion=7&originalVersion=6">View
Changes</a>
                |
        <a href="https://cwiki.apache.org/confluence/display/CAMEL/Loan+Broker+Example?showComments=true&amp;showCommentArea=true#addcomment">Add
Comment</a>
            </div>
</div>
</div>
</div>
</div>
</body>
</html>

Mime
View raw message