Author: ningjiang
Date: Sat Jun 26 01:51:12 2010
New Revision: 958166
URL: http://svn.apache.org/viewvc?rev=958166&view=rev
Log:
CAMEL-2858 deprecated the useOriginalBody() and add useOriginalMessage() method
in OnExceptionDefinition
Modified:
camel/trunk/camel-core/src/main/java/org/apache/camel/model/OnExceptionDefinition.java
Modified:
camel/trunk/camel-core/src/main/java/org/apache/camel/model/OnExceptionDefinition.java
URL:
http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/model/OnExceptionDefinition.java?rev=958166&r1=958165&r2=958166&view=diff
==============================================================================
---
camel/trunk/camel-core/src/main/java/org/apache/camel/model/OnExceptionDefinition.java
(original)
+++
camel/trunk/camel-core/src/main/java/org/apache/camel/model/OnExceptionDefinition.java
Sat Jun 26 01:51:12 2010
@@ -514,13 +514,35 @@ public class OnExceptionDefinition exten
* is the same as when Camel received it. So you should be able to send
the {...@link org.apache.camel.Exchange} to the same input.
* <p/>
* By default this feature is off.
- *
+ *
+ * @Deprecated this method will be removed after Camel 2.4.0, please use
useOriginalMessage().
* @return the builder
*/
+ @Deprecated
public OnExceptionDefinition useOriginalBody() {
setUseOriginalMessagePolicy(Boolean.TRUE);
return this;
}
+
+ /**
+ * Will use the original input message when an {...@link
org.apache.camel.Exchange} is moved to the dead letter queue.
+ * <p/>
+ * <b>Notice:</b> this only applies when all redeliveries attempt have
failed and the {...@link org.apache.camel.Exchange} is doomed for failure.
+ * <br/>
+ * Instead of using the current inprogress {...@link
org.apache.camel.Exchange} IN body we use the original IN body instead. This
allows
+ * you to store the original input in the dead letter queue instead of the
inprogress snapshot of the IN body.
+ * For instance if you route transform the IN body during routing and then
failed. With the original exchange
+ * store in the dead letter queue it might be easier to manually re submit
the {...@link org.apache.camel.Exchange} again as the IN body
+ * is the same as when Camel received it. So you should be able to send
the {...@link org.apache.camel.Exchange} to the same input.
+ * <p/>
+ * By default this feature is off.
+ *
+ * @return the builder
+ */
+ public OnExceptionDefinition useOriginalMessage() {
+ setUseOriginalMessagePolicy(Boolean.TRUE);
+ return this;
+ }
/**
* Sets a processor that should be processed <b>before</b> a redelivery
attempt.