camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From conflue...@apache.org
Subject [CONF] Apache Camel > Stub
Date Fri, 02 Mar 2012 16:13: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/Stub">Stub</a></h2>
    <h4>Page <b>edited</b> by             <a href="https://cwiki.apache.org/confluence/display/~jstrachan">James
Strachan</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" >Under the covers the Stub component
creates [VM] endpoints. <br> <br></td></tr>
            <tr><td class="diff-changed-lines" >So if you are in development and
want to try a route out but don&#39;t want to connect to a specific <span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">[Smtp]</span>
<span class="diff-added-words"style="background-color: #dfd;">[SMTP]</span> or
[Http] endpoint, just put *stub:* in front and stub it out! :) <br></td></tr>
            <tr><td class="diff-unchanged" > <br>h3. URI format <br></td></tr>
            <tr><td class="diff-snipped" >...<br></td></tr>
    
            </table>
    </div>                            <h4>Full Content</h4>
                    <div class="notificationGreySide">
        <h2><a name="Stub-StubComponent"></a>Stub Component</h2>

<p><b>Available as of Camel 2.10</b></p>

<p>The <b>stub:</b> component provides a simple way to stub out any physical
endpoints for easy testing. Just add <b>stub:</b> in front of any endpoint URI
and things just work.</p>

<p>Under the covers the Stub component creates <a href="/confluence/display/CAMEL/VM"
title="VM">VM</a> endpoints.</p>

<p>So if you are in development and want to try a route out but don't want to connect
to a specific <a href="/confluence/pages/createpage.action?spaceKey=CAMEL&amp;title=SMTP&amp;linkCreation=true&amp;fromPageId=27839951"
class="createlink">SMTP</a> or <a href="/confluence/display/CAMEL/HTTP" title="HTTP">HTTP</a>
endpoint, just put <b>stub:</b> in front and stub it out! <img class="emoticon"
src="/confluence/images/icons/emoticons/smile.gif" height="20" width="20" align="absmiddle"
alt="" border="0"/></p>

<h3><a name="Stub-URIformat"></a>URI format</h3>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
stub:someUri
</pre>
</div></div>

<p>Where <b><tt>someUri</tt></b> can be any URI at all with
any query. </p>

<p><b>Note</b> the main difference between <a href="/confluence/display/CAMEL/Stub"
title="Stub">Stub</a> and <a href="/confluence/display/CAMEL/VM" title="VM">VM</a>
is that <a href="/confluence/display/CAMEL/VM" title="VM">VM</a> will validate
the URI and parameters you give it; so putting vm: in front of a typical URI with query arguments
will typically fail; Stub wont though, it will basically ignore all the query parameters to
let you quickly just stub out one or more endpoints in your route temporarily. </p>

<h3><a name="Stub-Examples"></a>Examples</h3>

<p>Here's a few samples</p>

<ul>
	<li>stub:smtp://somehost.foo.com?user=whatnot&amp;something=else</li>
	<li>stub:<a href="http://somehost.bar.com/something" class="external-link" rel="nofollow">http://somehost.bar.com/something</a></li>
</ul>


<h3><a name="Stub-SeeAlso"></a>See Also</h3>
<ul>
	<li><a href="/confluence/display/CAMEL/Configuring+Camel" title="Configuring Camel">Configuring
Camel</a></li>
	<li><a href="/confluence/display/CAMEL/Component" title="Component">Component</a></li>
	<li><a href="/confluence/display/CAMEL/Endpoint" title="Endpoint">Endpoint</a></li>
	<li><a href="/confluence/display/CAMEL/Getting+Started" title="Getting Started">Getting
Started</a></li>
</ul>

    </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/Stub">View Online</a>
        |
        <a href="https://cwiki.apache.org/confluence/pages/diffpagesbyversion.action?pageId=27839951&revisedVersion=4&originalVersion=3">View
Changes</a>
                |
        <a href="https://cwiki.apache.org/confluence/display/CAMEL/Stub?showComments=true&amp;showCommentArea=true#addcomment">Add
Comment</a>
            </div>
</div>
</div>
</div>
</div>
</body>
</html>

Mime
View raw message