camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From conflue...@apache.org
Subject [CONF] Apache Camel > RedeliveryPolicy
Date Sun, 13 Feb 2011 14:54:00 GMT
<html>
<head>
    <base href="https://cwiki.apache.org/confluence">
            <link rel="stylesheet" href="/confluence/s/2036/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/RedeliveryPolicy">RedeliveryPolicy</a></h2>
    <h4>Page  <b>added</b> by             <a href="https://cwiki.apache.org/confluence/display/~davsclaus">Claus
Ibsen</a>
    </h4>
         <br/>
    <div class="notificationGreySide">
         <h2><a name="RedeliveryPolicy-RedeliveryPolicy"></a>RedeliveryPolicy</h2>

<p>A redelivery policy defines rules when Camel <a href="/confluence/display/CAMEL/Error+Handler"
title="Error Handler">Error Handler</a> perform redelivery attempts. For example
you can setup rules that state how many times to try redelivery, and the delay in between
attempts, and so forth.</p>

<p>You can use redelivery policies at two places in Camel:</p>
<ul class="alternate" type="square">
	<li><a href="/confluence/display/CAMEL/Error+Handler" title="Error Handler">Error
Handler</a></li>
	<li><a href="/confluence/display/CAMEL/Exception+Clause" title="Exception Clause">onException</a></li>
</ul>


<p>For example you can define a default error handler to redelivery at most 3 times</p>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
errorHandler(defaultErrorHandler().maximumRedeliveries(3));
</pre>
</div></div>

<p>And in XML</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-xml">
<span class="code-tag">&lt;errorHandler id=<span class="code-quote">"defaultEH"</span>&gt;</span>
  <span class="code-tag">&lt;redeliveryPolicy maximumRedeliveries=<span class="code-quote">"3"</span>/&gt;</span>
<span class="code-tag">&lt;/errorHandler&gt;</span>
</pre>
</div></div>

<p>See more details at <a href="/confluence/display/CAMEL/Error+Handler" title="Error
Handler">Error Handler</a>.</p>

<div class='panelMacro'><table class='tipMacro'><colgroup><col width='24'><col></colgroup><tr><td
valign='top'><img src="/confluence/images/icons/emoticons/check.gif" width="16" height="16"
align="absmiddle" alt="" border="0"></td><td>The Camel <a href="/confluence/display/CAMEL/Error+Handler"
title="Error Handler">Error Handler</a> is covered in great details in the <a
href="/confluence/display/CAMEL/Books" title="Books">Camel in Action book</a> where
the entire chapter 6 has been devoted.</td></tr></table></div>


<h3><a name="RedeliveryPolicy-UsingRedeliveryPolicyProfiles"></a>Using RedeliveryPolicyProfiles</h3>
<p><b>Available as of Camel 2.7</b></p>

<p>In the XML snippet below we have defined a <tt>&lt;redeliveryPolicyProfile&gt;</tt>
which we can refer to from the <tt>&lt;errorHandler&gt;</tt>.<br/>
TODO: e1 /org/apache/camel/spring/processor/SpringErrorHandlerRedeliveryPolicyProfileTest.xml</p>

<p>Camel's <a href="/confluence/display/CAMEL/Properties" title="Properties">Properties</a>
placeholder is also supported which the following XML example shows:</p>

<p>TODO: e1 /org/apache/camel/component/properties/SpringPropertiesComponentOnExceptionRefTest.xml</p>

<p>And you can also use Spring Frameworks property placeholders as shown below:</p>

<p>TODO: e1 /org/apache/camel/component/properties/SpringPropertyPlaceholderOnExceptionRefTest.xml</p>

<h3><a name="RedeliveryPolicy-SeeAlso"></a>See Also</h3>
<ul class="alternate" type="square">
	<li><a href="/confluence/display/CAMEL/Error+Handler" title="Error Handler">Error
Handler</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/RedeliveryPolicy">View
Online</a>
              |
       <a href="https://cwiki.apache.org/confluence/display/CAMEL/RedeliveryPolicy?showComments=true&amp;showCommentArea=true#addcomment">Add
Comment</a>
           </div>
</div>
</div>
</div>
</div>
</body>
</html>

Mime
View raw message