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 7C99818F0C for ; Wed, 13 Jan 2016 14:05:40 +0000 (UTC) Received: (qmail 14198 invoked by uid 500); 13 Jan 2016 14:05:40 -0000 Delivered-To: apmail-camel-issues-archive@camel.apache.org Received: (qmail 14127 invoked by uid 500); 13 Jan 2016 14:05:40 -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 14108 invoked by uid 99); 13 Jan 2016 14:05:40 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 13 Jan 2016 14:05:40 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id DB8C92C1F57 for ; Wed, 13 Jan 2016 14:05:39 +0000 (UTC) Date: Wed, 13 Jan 2016 14:05:39 +0000 (UTC) From: "Andrea Cosentino (JIRA)" To: issues@camel.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CAMEL-9505) RabbitMQConsumer don't use Camel ExceptionHandler BEFORE requeing message MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CAMEL-9505?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15096226#comment-15096226 ] Andrea Cosentino commented on CAMEL-9505: ----------------------------------------- It makes sense. You're right. I'll push this change. Anyway, if you want, we love contributions: http://camel.apache.org/contributing.html > RabbitMQConsumer don't use Camel ExceptionHandler BEFORE requeing message > ------------------------------------------------------------------------- > > Key: CAMEL-9505 > URL: https://issues.apache.org/jira/browse/CAMEL-9505 > Project: Camel > Issue Type: Bug > Components: camel-rabbitmq > Affects Versions: 2.16.1 > Reporter: Arnaud CHOTARD > Assignee: Andrea Cosentino > Fix For: 2.15.6, 2.16.2, 2.17.0 > > > The use case is : > onException(NotHandledException.class) > .handled(false) > .log("Exception not handled"); > onException(HandledException.class) > .handled(true) > .log("Exception handled"); > from("rabbitmq://...&autoAck=false") > .setHeader(RabbitMQConstants.REQUEUE, constant(true)) > .to(...); > If the route generate a NotHandledException, the message is requeue in RabbitMQ, it works fine. > If the route generate a HandledException, the message is requeue in RabbitMQ before the execution of Camel ExceptionHandler wich should handle the exception and should not propagate it. > The message handled by Camel ExceptionHandler should not be requeue in RabbitMQ since the exception is handled. > The related code is in : > org.apache.camel.component.rabbitmq.RabbitConsumer.handleDelivery > Maybe this line : > getExceptionHandler().handleException("Error processing exchange", exchange, exchange.getException()); > should be before : > if (deliveryTag != 0 && !consumer.endpoint.isAutoAck()) { > log.trace("Rejecting receipt [delivery_tag={}] with requeue={}", deliveryTag, isRequeueHeaderSet); > if (isRequeueHeaderSet) { > channel.basicReject(deliveryTag, true); > } else { > channel.basicReject(deliveryTag, false); > } > } -- This message was sent by Atlassian JIRA (v6.3.4#6332)