camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Trevv <...@safe-mail.net>
Subject Re: throwFault DSL doesn't actually throw?
Date Thu, 12 Feb 2009 04:38:42 GMT

Gee, I was wondering why no one answered my question.  Now I see that several
people answered, almost a week ago.  I never saw the answers, because all of
your messages are missing from the Nabble forum.

I think that .throwFault was actually working correctly (i.e. working as
designed) but I was surprised at first that it didn't actually "throw"
something, in the JLS sense of the word "throw."

I have a very simple exception handler [1] that catches any exception in my
Camel route, and formats it appropriately for my application's protocol, and
sends it back through MinaConsumer's TCP connection.  It's been working
fine.  After reading the Message Router wiki page, I originally thought that
a .throwFault would be a good way to throw a message back out to my
exception handler-- but of course I soon saw that that is not the purpose of
.throwFault.

So then I started using this idiom for throwing exceptions:

when(header("cheese").regex(".*\\b(?i:process).*")).
  process(new MyThrower("insert better cheese, please"))

and it seems to work well.

[1]
http://www.nabble.com/Re%3A-Exception-handling%2C-for-InOut-exchanges--p20676917s22882.html

P.S. The FishEye link on the  http://camel.apache.org/source.html Source 
wiki page also isn't working.
-- 
View this message in context: http://www.nabble.com/throwFault-DSL-doesn%27t-actually-throw--tp21865262s22882p21969838.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Mime
View raw message