Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id DE608200D3E for ; Wed, 1 Nov 2017 13:34:04 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id DD31E160BE6; Wed, 1 Nov 2017 12:34:04 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 35807160BEA for ; Wed, 1 Nov 2017 13:34:04 +0100 (CET) Received: (qmail 64324 invoked by uid 500); 1 Nov 2017 12:34:03 -0000 Mailing-List: contact issues-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@camel.apache.org Delivered-To: mailing list issues@camel.apache.org Received: (qmail 64306 invoked by uid 99); 1 Nov 2017 12:34:03 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 01 Nov 2017 12:34:03 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 6BB6F1830E1 for ; Wed, 1 Nov 2017 12:34:02 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -99.202 X-Spam-Level: X-Spam-Status: No, score=-99.202 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id hrqXPv6g8jqw for ; Wed, 1 Nov 2017 12:34:01 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id E349E5F4E5 for ; Wed, 1 Nov 2017 12:34:00 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 6884EE00A3 for ; Wed, 1 Nov 2017 12:34:00 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 22A95212F9 for ; Wed, 1 Nov 2017 12:34:00 +0000 (UTC) Date: Wed, 1 Nov 2017 12:34:00 +0000 (UTC) From: "Claus Ibsen (JIRA)" To: issues@camel.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (CAMEL-11045) onCompletion does not trigger on failure if split is in route MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Wed, 01 Nov 2017 12:34:05 -0000 [ https://issues.apache.org/jira/browse/CAMEL-11045?page=3Dcom.atlassi= an.jira.plugin.system.issuetabpanels:all-tabpanel ] Claus Ibsen updated CAMEL-11045: -------------------------------- Fix Version/s: 2.21.0 2.20.1 2.19.4 > onCompletion does not trigger on failure if split is in route > ------------------------------------------------------------- > > Key: CAMEL-11045 > URL: https://issues.apache.org/jira/browse/CAMEL-11045 > Project: Camel > Issue Type: Bug > Components: camel-core > Reporter: moritz l=C3=B6ser > Assignee: Claus Ibsen > Priority: Major > Fix For: 2.19.4, 2.20.1, 2.21.0 > > > I created a test to reproduce the problem: > {code} > import org.apache.camel.CamelExecutionException; > import org.apache.camel.Endpoint; > import org.apache.camel.EndpointInject; > import org.apache.camel.RoutesBuilder; > import org.apache.camel.builder.RouteBuilder; > import org.apache.camel.component.mock.MockEndpoint; > import org.apache.camel.test.junit4.CamelTestSupport; > import org.junit.Test; > import java.util.Arrays; > public class OnCompletionTest extends CamelTestSupport{ > @EndpointInject(uri =3D "direct:in") > private Endpoint in; > @EndpointInject(uri =3D "mock:completion") > private MockEndpoint mockComp; > @EndpointInject(uri =3D "mock:out") > private MockEndpoint mockOut; > @Test > public void good() throws InterruptedException { > mockComp.setExpectedMessageCount(1); > mockOut.setExpectedMessageCount(2); > // > context.createProducerTemplate().sendBody(in, Arrays.asList("1","= 2")); > // > assertMockEndpointsSatisfied(); > } > @Test > public void exception() throws InterruptedException { > mockComp.setExpectedMessageCount(1); > mockOut.setExpectedMessageCount(2); > // > mockOut.whenAnyExchangeReceived(exchange -> {throw new IllegalArg= umentException("");}); > try { > context.createProducerTemplate().sendBody(in, Arrays.asList("= 1","2")); > fail(); > } catch (CamelExecutionException e){ > } > // > mockOut.assertIsSatisfied(); > mockComp.assertIsSatisfied(); > } > @Override > public boolean isUseRouteBuilder() { > return true; > } > @Override > protected RoutesBuilder createRouteBuilder() throws Exception { > return new RouteBuilder() { > @Override > public void configure() throws Exception { > // @formatter:off > from(in) > .onCompletion().to(mockComp).end() > .split().body() > //.stopOnException() > //.shareUnitOfWork() > .to(mockOut) > ; > // @formatter:on > } > }; > } > } > {code} > I would expect that both tests pass. In case of exception the onCompletio= n is not triggered. Documentation says it should trigger in all cases. "onF= ailureOnly()" doesn't help either. I also tried "stopOnException()" and "sh= areUnitOfWork()" in some combinations with no avail. > If this works as intended there should be at least a hint in the document= ation. > For the sake of completeness i also asked here for a solution/ workaround= : http://stackoverflow.com/questions/42928208/camel-oncompletion-not-workin= g-on-exception-after-a-split-bug -- This message was sent by Atlassian JIRA (v6.4.14#64029)