Return-Path: X-Original-To: apmail-camel-issues-archive@minotaur.apache.org Delivered-To: apmail-camel-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id EB13196E8 for ; Thu, 23 Feb 2012 09:00:12 +0000 (UTC) Received: (qmail 16781 invoked by uid 500); 23 Feb 2012 09:00:12 -0000 Delivered-To: apmail-camel-issues-archive@camel.apache.org Received: (qmail 16758 invoked by uid 500); 23 Feb 2012 09:00:12 -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 16751 invoked by uid 99); 23 Feb 2012 09:00:12 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 23 Feb 2012 09:00:12 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 23 Feb 2012 09:00:09 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id CD0B43364F1 for ; Thu, 23 Feb 2012 08:59:48 +0000 (UTC) Date: Thu, 23 Feb 2012 08:59:48 +0000 (UTC) From: "Claus Ibsen (Updated) (JIRA)" To: issues@camel.apache.org Message-ID: <1373108271.9102.1329987588841.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <1614397517.3418.1329773374484.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Updated] (CAMEL-5021) camel-file: file is renamed but error handling continues. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/CAMEL-5021?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Claus Ibsen updated CAMEL-5021: ------------------------------- Fix Version/s: 2.10.0 2.9.1 2.8.5 > camel-file: file is renamed but error handling continues. > --------------------------------------------------------- > > Key: CAMEL-5021 > URL: https://issues.apache.org/jira/browse/CAMEL-5021 > Project: Camel > Issue Type: Bug > Components: camel-core > Affects Versions: 2.8.1 > Reporter: Sergey Zhemzhitsky > Assignee: Claus Ibsen > Labels: camel-file > Fix For: 2.8.5, 2.9.1, 2.10.0 > > > Symptoms: > # Exception is thrown from the child route with NoErrorHandler configured. > # Parent and child routes are linked with async. endpoints (seda, vm, nmr, etc.), which are configured to behave *synchronously* (attribute *waitForTaskToComplete=Always* in seda, vm-endpoints and attribute *synchronous=true* in nmr-endpoint). > The behavior with nmr endpoint is almost the same except for the next file is picked up before the lock on the previous one is released. > Here is a unit test to reproduce the issue: > {code:java|title=org.foo.bar.FileRedeliveryWithoutErrorHandlerTest.java} > package org.foo.bar; > import org.apache.camel.LoggingLevel; > import org.apache.camel.builder.RouteBuilder; > import org.apache.camel.component.mock.MockEndpoint; > import org.apache.camel.impl.JndiRegistry; > import org.apache.camel.processor.RedeliveryPolicy; > import org.apache.camel.test.junit4.CamelTestSupport; > import org.junit.After; > import org.junit.Before; > import org.junit.Test; > import java.io.File; > import static org.hamcrest.CoreMatchers.equalTo; > public class FileRedeliveryWithoutErrorHandlerTest extends CamelTestSupport { > private File newFile; > private File errorFile; > > @Before > @SuppressWarnings("ResultOfMethodCallIgnored") > public void createFile() throws Exception { > newFile = new File("target/files/in/newFile.txt"); > newFile.createNewFile(); > errorFile = new File("target/files/in/.error/newFile.txt"); > } > > @After > @SuppressWarnings("ResultOfMethodCallIgnored") > public void deleteFile() throws Exception { > newFile.delete(); > errorFile.delete(); > } > > @Test > public void testFileRedeliveryWithoutErrorHandler() throws Exception { > MockEndpoint result = getMockEndpoint("mock:result"); > result.setExpectedMessageCount(1); > result.assertIsNotSatisfied(); > > // created file have to exist because redelivery attempts are not completed > assertThat(newFile.exists(), equalTo(true)); > assertThat(errorFile.exists(), equalTo(false)); > } > @Override > protected JndiRegistry createRegistry() throws Exception { > JndiRegistry registry = super.createRegistry(); > RedeliveryPolicy policy = new RedeliveryPolicy(); > policy.setAsyncDelayedRedelivery(false); > policy.setLogRetryStackTrace(true); > policy.setMaximumRedeliveries(100); > policy.setMaximumRedeliveryDelay(30000); > policy.setRedeliveryDelay(1000); > policy.setUseExponentialBackOff(false); > policy.setRetryAttemptedLogLevel(LoggingLevel.WARN); > registry.bind("redeliveryPolicy", policy); > return registry; > } > @Override > protected RouteBuilder createRouteBuilder() throws Exception { > return new RouteBuilder() { > @Override > public void configure() throws Exception { > errorHandler(defaultErrorHandler()) > .onException(Exception.class) > .redeliveryPolicyRef("redeliveryPolicy") > .log(LoggingLevel.ERROR, "Error"); > from("file:target/files/in?initialDelay=100&delay=100&move=.backup&moveFailed=.error") > .to("seda:async?waitForTaskToComplete=Always&size=1") > .to("mock:result"); > from("seda:async") > .errorHandler(noErrorHandler()) > .delay(1000) > .throwException(new RuntimeException("Hello World!")); > } > }; > } > } > {code} -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira