Support Questions

Find answers, ask questions, and share your expertise

NiFi: invokehttp retries

avatar
Contributor

Hi..

i am using invokeHttp processor to consume my rest api but whenever 5xx http error retrying back to same processor (invoke Http) but its hitting my infinite time ..i want to limit retry count 5 and it retry at certain time like first retry after 1 min and second after 30 min and vice versa ....thanks in advance

umair

1 ACCEPTED SOLUTION

avatar

@umair ahmed

You could use the UpdateAttribute and RouteOnAttribute processors to create additional attributes on the flow file that keep track on the number of times the file has looped on a particular relationship. Here is an example of a flow that keep track of every relationship but the original flow file in the InvokeHttp processor:

15199-screen-shot-2017-05-08-at-95644-am.png

Here is the configuration of the UpdateAttribute processor

15196-screen-shot-2017-05-08-at-93007-am.png

The advanced UI in the RouteOnAttribute can be used to set the delay time using an attribute

15200-screen-shot-2017-05-08-at-100106-am.png

Here is the configuration of the RouteOnAttribute processor

15197-screen-shot-2017-05-08-at-93109-am.png

The delay is done using the ExecuteStreamCommand processor and calling the sleep command with the appropriate value to wait for the next attempt in using the InvokeHttp processor.

15201-screen-shot-2017-05-08-at-100410-am.png

You can adjust for your need.

View solution in original post

22 REPLIES 22

avatar
Contributor

@Wynner

C:\Users\bizruntime25>waitfor /T 10 test

ERROR: Timed out waiting for 'test'.

this is the output

avatar
Contributor

@Wynner

UpdateAttribute configurationconfiguration15270-screenshot-10.png

ExecuteStreamCommand configuration15281-screenshot-11.png

avatar
Contributor
@Wynner

thanks for your help

now its working ..