camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Hans Orbaan <>
Subject RE: move to failed folder, with onException in place
Date Thu, 05 Nov 2015 07:28:26 GMT
Hi Claus,

I think the following test will show you what I mean. Apparently the issue only occurs with

import java.util.concurrent.TimeUnit;

import org.apache.camel.Exchange;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.test.junit4.CamelTestSupport;
import org.junit.Test;

public class MoveToFailedTest extends CamelTestSupport {

    public void setUp() throws Exception {

    public void testExceptionSeda() throws Exception {

    public void testExceptionDirect() throws Exception {

    private void testException() throws InterruptedException {

        template.sendBodyAndHeader("file:target/test", "abc", Exchange.FILE_NAME, "file.txt");
        this.assertMockEndpointsSatisfied(1, TimeUnit.SECONDS);

    protected RouteBuilder createRouteBuilder() throws Exception {
        return new RouteBuilder() {

            public void configure() throws Exception {
                String errors = getTestMethodName().contains("Seda") ? "seda:errors" : "direct:errors";

                // @formatter:off

                    .throwException(new RuntimeException("exception"))
                // @formatter:on


-----Oorspronkelijk bericht-----
Van: Claus Ibsen [] 
Verzonden: Saturday 31 October 2015 18:26
Onderwerp: Re: move to failed folder, with onException in place

I think you need to tell us a bit more before we can help. Maybe show a bit more route code
what you attempt.

On Thu, Oct 29, 2015 at 2:28 PM, Hans Orbaan <> wrote:
> Hi all,
> Why is a file not moved to the failed folder when there is an onexception with a to-endpoint?
> When I use the following the file does not show up in the failed folder:
> onException(Exception.class).handled(false).to("seda:errors").end();
> This does work, but is obviously not of any use:
> this.onException(Exception.class).handled(false).end();
> This also does work, and will be my workaround:
> this.onException(Exception.class).handled(false).multicast().to("seda:
> errors").end().end();
> There is an earlier topic about this. Where Clause says he will log a 
> ticket. Has that been done, has this been fixed? 
> d5685631.html
> I'm using 2.16.1-SNAPSHOT at the moment.

Claus Ibsen
----------------- @davsclaus
Camel in Action 2nd edition:
View raw message