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 15:17: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>edited</b> by             <a href="https://cwiki.apache.org/confluence/display/~davsclaus">Claus
Ibsen</a>
    </h4>
        <br/>
                         <h4>Changes (7)</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>{tip:Extensive coverage}
<br></td></tr>
            <tr><td class="diff-changed-lines" >The Camel [Error Handler] is covered
in great details in the [Camel in Action book|Books] where the entire chapter <span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">6</span>
<span class="diff-added-words"style="background-color: #dfd;">5</span> has been
devoted. <br></td></tr>
            <tr><td class="diff-unchanged" >{tip} <br> <br></td></tr>
            <tr><td class="diff-snipped" >...<br></td></tr>
            <tr><td class="diff-unchanged" > <br>In the XML snippet below
we have defined a {{&lt;redeliveryPolicyProfile&gt;}} which we can refer to from the
{{&lt;errorHandler&gt;}}. <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">TODO:
e1 /org/apache/camel/spring/processor/SpringErrorHandlerRedeliveryPolicyProfileTest.xml <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">{snippet:id=e1|lang=xml|url=camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/SpringErrorHandlerRedeliveryPolicyProfileTest.xml}
<br></td></tr>
            <tr><td class="diff-unchanged" > <br>Camel&#39;s [Properties]
placeholder is also supported which the following XML example shows: <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">{snippet:id=e1|lang=xml|url=camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/org/apache/camel/component/properties/SpringPropertiesComponentOnExceptionRefTest.xml}
<br></td></tr>
            <tr><td class="diff-unchanged" > <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">TODO:
e1 /org/apache/camel/component/properties/SpringPropertiesComponentOnExceptionRefTest.xml
<br> <br></td></tr>
            <tr><td class="diff-unchanged" >And you can also use Spring Frameworks
property placeholders as shown below: <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">{snippet:id=e1|lang=xml|url=camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/org/apache/camel/component/properties/org/apache/camel/component/properties/SpringPropertyPlaceholderOnExceptionRefTest.xml}
<br></td></tr>
            <tr><td class="diff-unchanged" > <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">TODO:
e1 /org/apache/camel/component/properties/SpringPropertyPlaceholderOnExceptionRefTest.xml
<br></td></tr>
            <tr><td class="diff-unchanged" > <br>h3. See Also <br></td></tr>
            <tr><td class="diff-snipped" >...<br></td></tr>
    
            </table>
    </div>                            <h4>Full Content</h4>
                    <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 5 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>.</p>
<div class="error"><span class="error">Error formatting macro: snippet: java.lang.IndexOutOfBoundsException:
Index: 20, Size: 20</span> </div>

<p>Camel's <a href="/confluence/display/CAMEL/Properties" title="Properties">Properties</a>
placeholder is also supported which the following XML example shows:</p>
<div class="error"><span class="error">Error formatting macro: snippet: java.lang.IndexOutOfBoundsException:
Index: 20, Size: 20</span> </div>

<p>And you can also use Spring Frameworks property placeholders as shown below:</p>
<div class="error"><span class="error">Error formatting macro: snippet: java.lang.IndexOutOfBoundsException:
Index: 20, Size: 20</span> </div>


<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/pages/diffpagesbyversion.action?pageId=25201828&revisedVersion=2&originalVersion=1">View
Changes</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