Thanks Gert for these information !

I foudn the way to configure the deadLetterChannel Behavior but I stil can't
configure the final exception behavior.

>> If you want the DeadLetterChannel handling to fail (instead of log) after
the redelivery attempts, you can end the deadLetterChannel()
>> clause in your RouteBuilder with .throwFault() to force the exception.

The .throwFault() method seems to be part of the ProcessorType class but the
ErrorHandlerBuilderSupport (and DeadLetterChannelBuilder) class doesn't have
such method.
Guided by your hint (specially reading your sentence "instead of log"), I've
looked for the log step and found the defaultDeadLetterEndpointUri which
points to log:org.apache.camel.DeadLetterChannel?level=error";

So if I change the default dead letter endpoint to the following, does this
make the exception trick ?

        deadLetterChannel.setDefaultDeadLetterEndpoint(new Processor() {
            public void process(Exchange exchange) throws Exception {
                throw new CamelExchangeException("All message redeliveries
failed", exchange);
            }
        });

Manuel

On Mon, Jul 21, 2008 at 7:57 AM, Gert Vanthienen <[EMAIL PROTECTED]>
wrote:

> Manuel,
>
> If you do not configure any specific ErrorHandler in your Camel
> RouteBuilder, Camel will default to using a DeadLetterChannel handler with
> 5? re-delivery attempts and logging an error after these delivery attempts.
>  From a JBI perspective, by logging the error message, it has been handled
> and that's why you are getting the DONE status back.  We're looking to
> changing this default behavior for a next release of Camel.
>
> For now, you can configure a more appropriate ErrorHandler yourself.  If
> you want no error handling by Camel at all, you can use
> errorHandler(noErrorHandler()) at the top of your RouteBuilder to get this
> done.  This page (http://activemq.apache.org/camel/error-handler.html)
> shows you a bit more information about configuring Camel error handler
> strategies.  You can also find examples on how to configure the
> deadletterchannel.  If you want the DeadLetterChannel handling to fail
> (instead of log) after the redelivery attempts, you can end the
> deadLetterChannel() clause in your RouteBuilder with .throwFault() to force
> the exception.
>
> Regards,
>
> Gert
>
>
> Manuel EVENO wrote:
>
>> Hi,
>>
>> I've got a mediation with cxf-bc:consumer -> camel ( cxf-bc:provider ->
>> saxon:xquery )
>>
>> Here is the camel route :
>>        from("jbi:service:
>> http://hello.samples.sofinco.com/HelloServiceRoute";)
>>            .to("jbi:endpoint:
>> http://hello.samples.sofinco.com/HelloService/HelloService";)
>>            .to("jbi:endpoint:
>> http://hello.samples.sofinco.com/HelloServiceTransform/HelloServiceTransform
>> ");
>>
>> When the called service (the one used by cxf-bc:provider) is unreachable,
>> no exception is returned to the calling client (the one calling the ESB).
>> The client failed either on a timeout (if the redelivery process takes
>> long time) or by receiving a wrong ouput message (the input message)
>> Why doesn't the default behavior simply send an error ?
>>
>> More strange, the message exchange finished on a 'done' status instead of
>> a 'error' status ...
>>
>> How to configure servicemix (or camel) to send an error back to the client
>> when an error occurs in a message exchange
>> and after the redelivery attempts all failed ?
>>
>> Manuel
>>
>>
>
>

Reply via email to