Return-Path: X-Original-To: apmail-nifi-users-archive@minotaur.apache.org Delivered-To: apmail-nifi-users-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 0E07D1876D for ; Mon, 9 Nov 2015 14:51:25 +0000 (UTC) Received: (qmail 86183 invoked by uid 500); 9 Nov 2015 14:51:24 -0000 Delivered-To: apmail-nifi-users-archive@nifi.apache.org Received: (qmail 86156 invoked by uid 500); 9 Nov 2015 14:51:24 -0000 Mailing-List: contact users-help@nifi.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@nifi.apache.org Delivered-To: mailing list users@nifi.apache.org Received: (qmail 86146 invoked by uid 99); 9 Nov 2015 14:51:24 -0000 Received: from Unknown (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 09 Nov 2015 14:51:24 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 68ABBC070B for ; Mon, 9 Nov 2015 14:51:24 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 0.88 X-Spam-Level: X-Spam-Status: No, score=0.88 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_REPLY=1, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=disabled Authentication-Results: spamd4-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-us-east.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id hIhsjk4lmYiC for ; Mon, 9 Nov 2015 14:51:15 +0000 (UTC) Received: from mail-lf0-f45.google.com (mail-lf0-f45.google.com [209.85.215.45]) by mx1-us-east.apache.org (ASF Mail Server at mx1-us-east.apache.org) with ESMTPS id 15560441A7 for ; Mon, 9 Nov 2015 14:51:14 +0000 (UTC) Received: by lfs39 with SMTP id 39so69676552lfs.3 for ; Mon, 09 Nov 2015 06:51:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=oQBelHR6MZjYEP0Y+Ae7SPyLPD1hX7jaR0M3AL7iujY=; b=J4wQsJmyLm3UgvaBeJxjXRvgDzEnnqjlR72pzEwDU8uBMJf6Lgk9w4PK5ya/FX6egm ReWn7ZcmApbwpeNtILTIpqeMgWgLdxcLbPdgKIaBCG56KZBiaqrAo58TX/QDwqgJf2hw V2V8/yO/GiG230aQDecyAAX4495zxvtalkua9yy/0PCQIiJo451/aRhPKdg8ci/jtRxS VDf8eh6Jp91ZFJHSy5e14VcQsQ5si9fljdC8QVFtJtZghgVkadroRsJNwPBK9VonbLgy 2uUR+2i8rG1teo8aHYhgJaeD4YB4uSd2WTrUYgbExiRAAgzlFdyJQ6cHzyT6vu/zMF+1 BRng== MIME-Version: 1.0 X-Received: by 10.25.8.7 with SMTP id 7mr6190379lfi.52.1447080673668; Mon, 09 Nov 2015 06:51:13 -0800 (PST) Received: by 10.112.2.5 with HTTP; Mon, 9 Nov 2015 06:51:13 -0800 (PST) In-Reply-To: <1772609282.1594580.1447079907080.JavaMail.yahoo@mail.yahoo.com> References: <1729454364.1448692.1447044271675.JavaMail.yahoo@mail.yahoo.com> <1772609282.1594580.1447079907080.JavaMail.yahoo@mail.yahoo.com> Date: Mon, 9 Nov 2015 09:51:13 -0500 Message-ID: Subject: Re: Nifi - InvokeHTTP - retrying on 3xx with Location header issue From: Joe Witt To: users@nifi.apache.org, M Singh Content-Type: text/plain; charset=UTF-8 Mans, Being new to NiFi or even contributing to open source at all is not a problem. We're here to help. Ask questions as needed and we can help you contribute. Thanks Joe On Mon, Nov 9, 2015 at 9:38 AM, M Singh wrote: > Hi Joe: > > I was looking at the InvokeHttp code and I can work on enhancing the 3xx > issue based on the pattern for handling other statuses. However, I would > like to add a newbie caveat here. > > Let me know if that would help. > > Thanks > > Mans > > > > On Sunday, November 8, 2015 8:44 PM, M Singh wrote: > > > Hi Joe: > > You are right - setting follow-redirects did not work and I did mix retry > with redirect. > > I will wait for your enhancements. > > Thanks again for your help. > > > > On Sunday, November 8, 2015 8:31 PM, Joe Percivall > wrote: > > > Hello, > > > Firstly, I think you're mixing up "retry" and "redirect". The 3xx status > code is for redirecting to another url and 5xx is to try again. The property > we have is "Follow Redirects". Retrying doesn't involve a location header > but the redirect does. That being said, I did a bit of digging I don't think > InvokeHttp was handling redirects properly. All we were doing was setting > the "setInstanceFollowRedirects" to true, which according to this site [1] > doesn't fully handle it. > > I am going to attach a patch to ticket 1086[2] tonight for InvokeHttp's > refactor to use OkHttp instead of HttpUrlConnection. If you'd like to test > that out and see if that it solves the redirect and location header problem > that would be awesome. > > [1] > http://www.mkyong.com/java/java-httpurlconnection-follow-redirect-example/ > [2] https://issues.apache.org/jira/browse/NIFI-1086 > > Joe > - - - - - - > Joseph Percivall > linkedin.com/in/Percivall > e: joepercivall@yahoo.com > > > > > On Sunday, November 8, 2015 9:53 PM, Joe Witt wrote: > > > > Joe P, > > Do you have any other recommendations light of the work you're doing > now to Invoke HTTP? > > Thanks > Joe > > > On Sun, Nov 8, 2015 at 9:49 PM, M Singh wrote: >> Thanks Joe. >> >> When I look at the provenance of the flow file, it shows the status as 301 >> as shown below but no Location attribute. >> >> If I curl the url and check the headers it does show the Location >> attribute. >> >> invokehttp.status.code 301 >> >> >> >> >> On Sunday, November 8, 2015 4:58 PM, Joe Witt wrote: >> >> >> Hello >> >> You can use provenance or a LogAttributes processor to see what the >> headers are of the flow file after InvokeHTTP executes. You may find >> the location header present as one of the attributes. If so then you >> should be able to use that attribute to establish the URL it will hit >> next time. Does that help? >> >> Thanks >> Joe >> >> On Sun, Nov 8, 2015 at 7:51 PM, M Singh wrote: >>> Hi: >>> >>> I am trying to use InvokeHTTP and have set the follow-retry to true, and >>> have associated a self referencing relation for the InvokeHttp for >>> no-retry >>> (1xx, 2xx, and 3xx) and retry (5xx) relations. But it looks like it >>> retires >>> only status 500 codes requests and for 3xx does not pick up the Location >>> header for retrying. >>> >>> However, since I am new to nifi - I might be missing something or using >>> the >>> wrong settings or wrong processor. >>> >>> If anyone has any suggestion, please let me know. >>> >>> Thanks >>> >> >> > > > >