Re: Camel 3.1.0: error handling changed, route no longer stops

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: Camel 3.1.0: error handling changed, route no longer stops

Remco Schoen
Hi,

The files have been removed, so I post the import parts of it.

The strategy:


Exchange aggregate(Exchange oldExchange, Exchange newExchange) {
    oldExchange.in.body = newExchange.in.body

    // Default Camel: Enricher.defaultAggregationStrategy()
    // Default Camel: Enricher => CopyAggregationStrategy
    if (newExchange.properties.CamelErrorHandlerHandled) {
        oldExchange.properties.CamelErrorHandlerHandled = newExchange.properties.CamelErrorHandlerHandled
    }

    return oldExchange
}

The test:


void configure() throws Exception {
    DeadLetterChannelBuilder deadLetterChannelBuilder = deadLetterChannel(ErrorRoutes.ERROR)
    deadLetterChannelBuilder.setUseOriginalMessage(true)

    from("direct:failingRoute")
        .errorHandler(deadLetterChannelBuilder)
        .to("mock:failingRoute")
        .throwException(new RuntimeException('Boem!'))

    from("direct:nextRoute")
        .to("mock:nextRoute")

    from('direct:start')
        .enrich('direct:failingRoute', new BodyOnlyAggregationStrategy())
        .to('direct:nextRoute')
}


void exceptionRouteTest() {
    getMockEndpoint("mock:failingRoute").expectedMessageCount(1)
    getMockEndpoint("mock:nextRoute").expectedMessageCount(0)

    template.sendBody('direct:start', null)

    assertMockEndpointsSatisfied()
}

Regards,

Remco

Op 9 mrt. 2020, om 15:47 heeft Remco Schoen <[hidden email]<mailto:[hidden email]>> het volgende geschreven:

Hi,

I noticed that the error handling has changed in 3.1.0 from 3.0.1. We use a DeadLetterChannel and when the error has been handled, I expect the original route to stop and not to continue.

When we use enrich we pass the exchange property CamelErrorHandlerHandled back to ensure the calling route stops, but that has changed. Is this correct and should we change our aggregation strategy?

I added the strategy and it’s test.

Kind regards,

Remco Schoen




Reply | Threaded
Open this post in threaded view
|

Re: Camel 3.1.0: error handling changed, route no longer stops

gnodet
Would you mind raising a JIRA issue and attaching your test ?
I'll have a look at the problem.

Le lun. 9 mars 2020 à 15:48, Remco Schoen <[hidden email]> a écrit :

> Hi,
>
> I noticed that the error handling has changed in 3.1.0 from 3.0.1. We use
> a DeadLetterChannel and when the error has been handled, I expect the
> original route to stop and not to continue.
>
> When we use enrich we pass the exchange property CamelErrorHandlerHandled
> back to ensure the calling route stops, but that has changed. Is this
> correct and should we change our aggregation strategy?
>
> I added the strategy and it’s test.
>
> Kind regards,
>
> Remco Schoen
>
>
>
>

--
------------------------
Guillaume Nodet
Reply | Threaded
Open this post in threaded view
|

Re: Camel 3.1.0: error handling changed, route no longer stops

Remco Schoen
Hi,

I raised an issue:
https://issues.apache.org/jira/browse/CAMEL-14684

Op 9 mrt. 2020, om 16:17 heeft Guillaume Nodet <[hidden email]> het volgende geschreven:

Would you mind raising a JIRA issue and attaching your test ?
I'll have a look at the problem.

Le lun. 9 mars 2020 à 15:48, Remco Schoen <[hidden email]<mailto:[hidden email]>> a écrit :

Hi,

I noticed that the error handling has changed in 3.1.0 from 3.0.1. We use
a DeadLetterChannel and when the error has been handled, I expect the
original route to stop and not to continue.

When we use enrich we pass the exchange property CamelErrorHandlerHandled
back to ensure the calling route stops, but that has changed. Is this
correct and should we change our aggregation strategy?

I added the strategy and it’s test.

Kind regards,

Remco Schoen





--
------------------------
Guillaume Nodet