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 B074A9238 for ; Wed, 1 Feb 2012 09:01:51 +0000 (UTC) Received: (qmail 26827 invoked by uid 500); 1 Feb 2012 09:01:45 -0000 Delivered-To: apmail-camel-issues-archive@camel.apache.org Received: (qmail 26780 invoked by uid 500); 1 Feb 2012 09:01:39 -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 26724 invoked by uid 99); 1 Feb 2012 09:01:26 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 01 Feb 2012 09:01:26 +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; Wed, 01 Feb 2012 09:01:21 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 61639183404 for ; Wed, 1 Feb 2012 09:01:00 +0000 (UTC) Date: Wed, 1 Feb 2012 09:01:00 +0000 (UTC) From: "Willem Jiang (Resolved) (JIRA)" To: issues@camel.apache.org Message-ID: <518626505.2047.1328086860400.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <820771627.81211.1327585242387.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Resolved] (CAMEL-4945) CXF Producer calls done method of Camel callback several times 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-4945?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Willem Jiang resolved CAMEL-4945. --------------------------------- Resolution: Fixed > CXF Producer calls done method of Camel callback several times > -------------------------------------------------------------- > > Key: CAMEL-4945 > URL: https://issues.apache.org/jira/browse/CAMEL-4945 > Project: Camel > Issue Type: Bug > Components: camel-cxf > Affects Versions: 2.8.3, 2.9.0 > Reporter: Stefan Boller > Assignee: Willem Jiang > Fix For: 2.8.5, 2.9.1, 2.10.0 > > Attachments: CAMEL-4945.patch > > > If the CXF Producer of Camel is called asynchronously for a WS-RM endpoint, Camel receives multiple final events, like ExchangeCompletedEvent and ExchangeFailedEvent. This leads also to negative JMX counters for inflight exchanges. The root cause is a bug in the handleResponse and handleException methods of org.apache.camel.component.cxf.CxfClientCallback. In those methods, which are called for WS-RM communication, although it is oneway, the done method of camelAsyncCallback is called also for oneway exchanges. However this callback method is already called in the process method of org.apache.camel.component.cxf.CxfProducer for oneway exchanges, which causes the mentioned effects. > The following changes in org.apache.camel.component.cxf.CxfClientCallback can fix this: > public void handleResponse(Map ctx, Object[] res) { > try { > super.handleResponse(ctx, res); > } finally { > // bind the CXF response to Camel exchange > if (!boi.getOperationInfo().isOneWay()) { > // copy the InMessage header to OutMessage header > camelExchange.getOut().getHeaders().putAll(camelExchange.getIn().getHeaders()); > binding.populateExchangeFromCxfResponse(camelExchange, cxfExchange, ctx); > camelAsyncCallback.done(false); > } > if (LOG.isDebugEnabled()) { > LOG.debug("{} calling handleResponse", Thread.currentThread().getName()); > } > } > } > > public void handleException(Map ctx, Throwable ex) { > try { > super.handleException(ctx, ex); > camelExchange.setException(ex); > } finally { > // copy the context information > if (!boi.getOperationInfo().isOneWay()) { > // copy the InMessage header to OutMessage header > camelExchange.getOut().getHeaders().putAll(camelExchange.getIn().getHeaders()); > binding.populateExchangeFromCxfResponse(camelExchange, cxfExchange, ctx); > camelAsyncCallback.done(false); > } > if (LOG.isDebugEnabled()) { > LOG.debug("{} calling handleException", Thread.currentThread().getName()); > } > } > } -- 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