Author: buildbot
Date: Tue May 8 08:22:51 2012
New Revision: 816481
Log:
Production update by buildbot for camel
Modified:
websites/production/camel/content/cache/main.pageCache
websites/production/camel/content/oncompletion.html
Modified: websites/production/camel/content/cache/main.pageCache
==============================================================================
Binary files - no diff available.
Modified: websites/production/camel/content/oncompletion.html
==============================================================================
--- websites/production/camel/content/oncompletion.html (original)
+++ websites/production/camel/content/oncompletion.html Tue May 8 08:22:51 2012
@@ -87,9 +87,14 @@
<ul class="alternate" type="square"><li>scope: global and/or per route (route
scope override all global scope)</li><li>multiple global
scope</li><li>triggered either always, only if completed with success, or only
if failed</li><li><tt>onWhen</tt> predicate to only trigger in certain
situations</li></ul>
+<div class="panelMacro"><table class="infoMacro"><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/information.gif"
width="16" height="16" alt="" border="0"></td><td colspan="1"
rowspan="1"><b>On completion runs in separate thread</b><br clear="none">The
<b>onCompletion</b> runs in a separate thread in parallel with the original
route. It is therefore not intended to influence the outcome of the original
route. The idea for on completion is to spin off a new thread to eg send logs
to a central log database, send an email, send alterts to a monitoring system,
store a copy of the result message etc.<br clear="none">
+Therefore if you want to do some work that influence the original route, then
do <b>not</b> use <b>onCompletion</b> for that. Notice: if you use the
<tt>UnitOfWork</tt> API as mentioned in the top of this page, then you can
register a <tt>Synchronization</tt> callback on the <a shape="rect"
href="exchange.html" title="Exchange">Exchange</a> which is executed in the
original route. That way allows you to do some custom code when the route is
completed; this is how custom components can enlist on completion services
which they need, eg the <a shape="rect" href="file2.html"
title="File2">File</a> component does that for work that moves/deletes the
original file etc.</td></tr></table></div>
+
<h3><a shape="rect"
name="OnCompletion-onCompletionwithroutescope"></a>onCompletion with route
scope</h3>
<p>The <b>onCompletion</b> DSL allows you to add custom routes/processors when
the original <a shape="rect" href="exchange.html" title="Exchange">Exchange</a>
is complete. Camel spin off a copy of the <a shape="rect" href="exchange.html"
title="Exchange">Exchange</a> and routes it in a separate thread, kinda like a
<a shape="rect" href="wire-tap.html" title="Wire Tap">Wire Tap</a>. This allows
the original thread to continue while the <b>onCompletion</b> route is running
concurrently. We decided for this model as we did not want the
<b>onCompletion</b> route to interfere with the original route.</p>
+
+
<div class="code panel" style="border-width: 1px;"><div class="codeContent
panelContent">
<pre class="code-java">from(<span class="code-quote">"direct:start"</span>)
.onCompletion()