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 0B7E2200B85 for ; Thu, 15 Sep 2016 19:15:00 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 0A199160AC6; Thu, 15 Sep 2016 17:15:00 +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 50800160ABA for ; Thu, 15 Sep 2016 19:14:59 +0200 (CEST) Received: (qmail 85212 invoked by uid 500); 15 Sep 2016 17:14:58 -0000 Mailing-List: contact issues-help@nifi.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@nifi.apache.org Delivered-To: mailing list issues@nifi.apache.org Received: (qmail 85203 invoked by uid 99); 15 Sep 2016 17:14:58 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 15 Sep 2016 17:14:58 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 6A0CAE0158; Thu, 15 Sep 2016 17:14:58 +0000 (UTC) From: olegz To: issues@nifi.apache.org Reply-To: issues@nifi.apache.org References: In-Reply-To: Subject: [GitHub] nifi pull request #1022: NIFI-2774 changed the default ACK mode to CLIENT Content-Type: text/plain Message-Id: <20160915171458.6A0CAE0158@git1-us-west.apache.org> Date: Thu, 15 Sep 2016 17:14:58 +0000 (UTC) archived-at: Thu, 15 Sep 2016 17:15:00 -0000 Github user olegz commented on a diff in the pull request: https://github.com/apache/nifi/pull/1022#discussion_r79015458 --- Diff: nifi-nar-bundles/nifi-jms-bundle/nifi-jms-processors/src/main/java/org/apache/nifi/jms/processors/ConsumeJMS.java --- @@ -78,22 +77,24 @@ */ @Override protected void rendezvousWithJms(ProcessContext context, ProcessSession processSession) throws ProcessException { - final JMSResponse response = this.targetResource.consume(); - if (response != null){ - FlowFile flowFile = processSession.create(); - flowFile = processSession.write(flowFile, new OutputStreamCallback() { - @Override - public void process(final OutputStream out) throws IOException { - out.write(response.getMessageBody()); - } - }); - Map jmsHeaders = response.getMessageHeaders(); - flowFile = this.updateFlowFileAttributesWithJmsHeaders(jmsHeaders, flowFile, processSession); - processSession.getProvenanceReporter().receive(flowFile, context.getProperty(DESTINATION).evaluateAttributeExpressions().getValue()); - processSession.transfer(flowFile, REL_SUCCESS); - } else { - context.yield(); - } + this.targetResource.consume(response -> { + if (response != null) { + FlowFile flowFile = processSession.create(); + flowFile = processSession.write(flowFile, new OutputStreamCallback() { + @Override + public void process(final OutputStream out) throws IOException { + out.write(response.getMessageBody()); + } + }); + Map jmsHeaders = response.getMessageHeaders(); + flowFile = this.updateFlowFileAttributesWithJmsHeaders(jmsHeaders, flowFile, processSession); + processSession.getProvenanceReporter().receive(flowFile, + context.getProperty(DESTINATION).evaluateAttributeExpressions().getValue()); + processSession.transfer(flowFile, REL_SUCCESS); --- End diff -- @ckmcd good catch. Indeed that window exists and we need to commit session within the callback and before message ack. Will address. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastructure@apache.org or file a JIRA ticket with INFRA. ---