You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by huntc <hu...@mac.com> on 2009/05/26 07:32:53 UTC

throwFault deprecated - what is the equivalent for 1.x?

Hi there,

Now that throwFault has been deprecated in 1.6.1, what should I be using to
avoid strike throughs and warnings in my pretty code. :working:

Christopher
-- 
View this message in context: http://www.nabble.com/throwFault-deprecated---what-is-the-equivalent-for-1.x--tp23717019p23717019.html
Sent from the Camel - Users (activemq) mailing list archive at Nabble.com.


Re: throwFault deprecated - what is the equivalent for 1.x?

Posted by Claus Ibsen <cl...@gmail.com>.
On Tue, May 26, 2009 at 8:13 AM, huntc <hu...@mac.com> wrote:
>
> I presume that setFaultBody has the same behaviour as throwFault right?
>
> My goal is to throw an exception and have the message got to the dead letter
> channel for retry processing.

Yes it has the same behavior. throwFault did not really throw an
exception as you can do in regular Java code.
It sets the FAULT message and then Camel detects this in its routing
and indicate the Exchange is failed and allow the DeadLetterChannel
to kick in and do redelivery or whatnot, just as if a regular
Exception was thrown.



>
> Thanks again.
> --
> View this message in context: http://www.nabble.com/throwFault-deprecated---what-is-the-equivalent-for-1.x--tp23717019p23717295.html
> Sent from the Camel - Users (activemq) mailing list archive at Nabble.com.
>
>



-- 
Claus Ibsen
Apache Camel Committer

Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus

Re: throwFault deprecated - what is the equivalent for 1.x?

Posted by huntc <hu...@mac.com>.
I presume that setFaultBody has the same behaviour as throwFault right?

My goal is to throw an exception and have the message got to the dead letter
channel for retry processing.

Thanks again.
-- 
View this message in context: http://www.nabble.com/throwFault-deprecated---what-is-the-equivalent-for-1.x--tp23717019p23717295.html
Sent from the Camel - Users (activemq) mailing list archive at Nabble.com.


Re: throwFault deprecated - what is the equivalent for 1.x?

Posted by Claus Ibsen <cl...@gmail.com>.
On Tue, May 26, 2009 at 8:06 AM, huntc <hu...@mac.com> wrote:
>
> Thanks Claus. I presume you meant:
>
> .setFaultBody(constant("Unknown notification sent by fingerprint reader"))

Yeah :) Looks like it accepts a Expression as parameter. Maybe we
should add a String as well as its common to set a String body.
But with an expression it allows you to use eg the simple language to
dynamic create a string, like Groovy g strings. Mostly useable from
Spring XML
as in regular Java you can use String.format or just + the string as you like.




>
> --
> View this message in context: http://www.nabble.com/throwFault-deprecated---what-is-the-equivalent-for-1.x--tp23717019p23717251.html
> Sent from the Camel - Users (activemq) mailing list archive at Nabble.com.
>
>



-- 
Claus Ibsen
Apache Camel Committer

Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus

Re: throwFault deprecated - what is the equivalent for 1.x?

Posted by huntc <hu...@mac.com>.
Thanks Claus. I presume you meant:

.setFaultBody(constant("Unknown notification sent by fingerprint reader"))

-- 
View this message in context: http://www.nabble.com/throwFault-deprecated---what-is-the-equivalent-for-1.x--tp23717019p23717251.html
Sent from the Camel - Users (activemq) mailing list archive at Nabble.com.


Re: throwFault deprecated - what is the equivalent for 1.x?

Posted by Claus Ibsen <cl...@gmail.com>.
On Tue, May 26, 2009 at 7:54 AM, huntc <hu...@mac.com> wrote:
>
> Hi Claus,
>
> There is a setFaultBody and a setFaultHeader but I am not sure of how to use
> these in place of throwFault. Do you have an example? Here's what I
> presently do:
>
> ...
>  .otherwise()
>  .throwFault(
>    "Unknown notification sent by fingerprint reader");
>
> Thanks for your time.

  .setFaultBody(
    "Unknown notification sent by fingerprint reader");

throwFault is renamed to throwException in Camel 2.0 as it is what we
need there.

And as a FAULT is just another Message just like IN or OUT, you should
use setFaultBody instead.


>
> Kind regards,
> Christopher
>
> --
> View this message in context: http://www.nabble.com/throwFault-deprecated---what-is-the-equivalent-for-1.x--tp23717019p23717157.html
> Sent from the Camel - Users (activemq) mailing list archive at Nabble.com.
>
>



-- 
Claus Ibsen
Apache Camel Committer

Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus

Re: throwFault deprecated - what is the equivalent for 1.x?

Posted by huntc <hu...@mac.com>.
Hi Claus,

There is a setFaultBody and a setFaultHeader but I am not sure of how to use
these in place of throwFault. Do you have an example? Here's what I
presently do:

...
  .otherwise()
  .throwFault(
    "Unknown notification sent by fingerprint reader");

Thanks for your time.

Kind regards,
Christopher

-- 
View this message in context: http://www.nabble.com/throwFault-deprecated---what-is-the-equivalent-for-1.x--tp23717019p23717157.html
Sent from the Camel - Users (activemq) mailing list archive at Nabble.com.


Re: throwFault deprecated - what is the equivalent for 1.x?

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

I believe there should be a setFault method.

On Tue, May 26, 2009 at 7:32 AM, huntc <hu...@mac.com> wrote:
>
> Hi there,
>
> Now that throwFault has been deprecated in 1.6.1, what should I be using to
> avoid strike throughs and warnings in my pretty code. :working:
>
> Christopher
> --
> View this message in context: http://www.nabble.com/throwFault-deprecated---what-is-the-equivalent-for-1.x--tp23717019p23717019.html
> Sent from the Camel - Users (activemq) mailing list archive at Nabble.com.
>
>



-- 
Claus Ibsen
Apache Camel Committer

Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus