Author: buildbot
Date: Sat Apr 27 08:18:46 2013
New Revision: 860086
Log:
Production update by buildbot for camel
Modified:
websites/production/camel/content/advicewith.html
websites/production/camel/content/cache/main.pageCache
Modified: websites/production/camel/content/advicewith.html
==============================================================================
--- websites/production/camel/content/advicewith.html (original)
+++ websites/production/camel/content/advicewith.html Sat Apr 27 08:18:46 2013
@@ -135,6 +135,13 @@ The Camel team plan for Camel 3.0 to sup
The wildcard is when the pattern ends with a * char, such as:
<tt>weaveById("foo*")</tt> which will match any id's starting with
<tt>"foo"</tt>, such as <tt>foo, foobar, foobie</tt> and so forth.<br
clear="none">
The regular expression is more advanced and allows you to match multiple ids,
such as <tt>weaveById("(foo|bar)")</tt> which will match both <tt>"foo"</tt>
and <tt>"bar"</tt>.</p>
+<div class="panelMacro"><table class="tipMacro"><colgroup span="1"><col
span="1" width="24"><col span="1"></colgroup><tr><td colspan="1" rowspan="1"
valign="top"><img align="middle"
src="https://cwiki.apache.org/confluence/images/icons/emoticons/check.gif"
width="16" height="16" alt="" border="0"></td><td colspan="1" rowspan="1">If
you try to match a <tt>pattern</tt> on an exact endpoint uri, then mind that
URI options ordering may influence, and hence its best to match by wildcard.
For example:
+<div class="code panel" style="border-width: 1px;"><div class="codeContent
panelContent">
+<pre class="code-java">
+mockEndpointsAndSkip(<span class="code-quote">"activemq:queue:foo?*"</span>)
+</pre>
+</div></div>
+<p>To match the foo queue and disregard any
options.</p></td></tr></table></div>
<h3><a shape="rect" name="AdviceWith-UsingweaveById"></a>Using weaveById</h3>
@@ -147,7 +154,8 @@ The regular expression is more advanced
<p>For example given the following route:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeHeader
panelHeader" style="border-bottom-width: 1px;"><b>Route</b></div><div
class="codeContent panelContent">
-<pre class="code-java">from(<span class="code-quote">"direct:start"</span>)
+<pre class="code-java">
+from(<span class="code-quote">"direct:start"</span>)
.to(<span class="code-quote">"mock:foo"</span>)
.to(<span class="code-quote">"mock:bar"</span>).id(<span
class="code-quote">"bar"</span>)
.to(<span class="code-quote">"mock:result"</span>);
@@ -275,7 +283,8 @@ You have to be a bit more careful when u
<p>For example to remove the first <tt>.to</tt> node in route you can do as
follows:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent
panelContent">
-<pre
class="code-java">context.getRouteDefinitions().get(0).adviceWith(context,
<span class="code-keyword">new</span> AdviceWithRouteBuilder() {
+<pre class="code-java">
+context.getRouteDefinitions().get(0).adviceWith(context, <span
class="code-keyword">new</span> AdviceWithRouteBuilder() {
@Override
<span class="code-keyword">public</span> void configure() <span
class="code-keyword">throws</span> Exception {
<span class="code-comment">// only remove the first to node in the
route
@@ -294,7 +303,8 @@ You have to be a bit more careful when u
<p>For example if you want to send a message to a <tt>mock:input</tt> endpoint
you can do as follows:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent
panelContent">
-<pre
class="code-java">context.getRouteDefinitions().get(0).adviceWith(context,
<span class="code-keyword">new</span> AdviceWithRouteBuilder() {
+<pre class="code-java">
+context.getRouteDefinitions().get(0).adviceWith(context, <span
class="code-keyword">new</span> AdviceWithRouteBuilder() {
@Override
<span class="code-keyword">public</span> void configure() <span
class="code-keyword">throws</span> Exception {
<span class="code-comment">// send the incoming message to mock:input
@@ -306,7 +316,8 @@ You have to be a bit more careful when u
<p>Likewise if you want to easily send a message to a <tt>mock:output</tt>
endpoint you can do as follows:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent
panelContent">
-<pre
class="code-java">context.getRouteDefinitions().get(0).adviceWith(context,
<span class="code-keyword">new</span> AdviceWithRouteBuilder() {
+<pre class="code-java">
+context.getRouteDefinitions().get(0).adviceWith(context, <span
class="code-keyword">new</span> AdviceWithRouteBuilder() {
@Override
<span class="code-keyword">public</span> void configure() <span
class="code-keyword">throws</span> Exception {
<span class="code-comment">// send the outgoing message to mock:output
@@ -318,7 +329,8 @@ You have to be a bit more careful when u
<p>You can of course combine those in the same advice with:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent
panelContent">
-<pre
class="code-java">context.getRouteDefinitions().get(0).adviceWith(context,
<span class="code-keyword">new</span> AdviceWithRouteBuilder() {
+<pre class="code-java">
+context.getRouteDefinitions().get(0).adviceWith(context, <span
class="code-keyword">new</span> AdviceWithRouteBuilder() {
@Override
<span class="code-keyword">public</span> void configure() <span
class="code-keyword">throws</span> Exception {
weaveAddFirst().to(<span class="code-quote">"mock:input"</span>);
@@ -334,7 +346,8 @@ You have to be a bit more careful when u
<p>You may have routes which consumes messages from endpoints which you want
to substitute with another endpoint for easier unit testing. For example a <a
shape="rect" href="jms.html" title="JMS">JMS</a> endpoint could be replaced
with a <a shape="rect" href="seda.html" title="SEDA">SEDA</a> or <a
shape="rect" href="direct.html" title="Direct">Direct</a> for unit testing a
route, as shown below where we replace the input of the route to a "seda:foo"
endpoint:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent
panelContent">
-<pre
class="code-java">context.getRouteDefinitions().get(0).adviceWith(context,
<span class="code-keyword">new</span> AdviceWithRouteBuilder() {
+<pre class="code-java">
+context.getRouteDefinitions().get(0).adviceWith(context, <span
class="code-keyword">new</span> AdviceWithRouteBuilder() {
@Override
<span class="code-keyword">public</span> void configure() <span
class="code-keyword">throws</span> Exception {
replaceFromWith(<span class="code-quote">"seda:foo"</span>);
Modified: websites/production/camel/content/cache/main.pageCache
==============================================================================
Binary files - no diff available.