Created 05-08-2017 06:53 AM
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
Created on 05-08-2017 01:34 PM - edited 08-17-2019 06:50 PM
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:
Here is the configuration of the UpdateAttribute processor
The advanced UI in the RouteOnAttribute can be used to set the delay time using an attribute
Here is the configuration of the RouteOnAttribute processor
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.
You can adjust for your need.
Created on 05-08-2017 01:34 PM - edited 08-17-2019 06:50 PM
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:
Here is the configuration of the UpdateAttribute processor
The advanced UI in the RouteOnAttribute can be used to set the delay time using an attribute
Here is the configuration of the RouteOnAttribute processor
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.
You can adjust for your need.
Created 05-08-2017 02:08 PM
Created 05-09-2017 05:23 AM
In ExecuteStreamCommand processor command path= ' usr/bin/sleep' what is this thing because i am getting exception in ExecuteStreamCommand processor .."The System cannot find the file specified"
and i am using windows
thanks
umair
Created 05-09-2017 12:33 PM
That is a command in Unix, to wait the amount of time specified, 30 seconds, one minute whatever is specified. The Windows equivalent is timeout I believe, so just replace the command.
Created 05-09-2017 12:48 PM
usr/bin/sleep is seem a directory structure
so i have to replace usr/bin/sleep to timeout only
or something else can you give me an example
thanks
umair
Created 05-09-2017 12:57 PM
Correct, just replace /usr/bin/sleep with timeout.
What version of Windows are you using?
Created 05-09-2017 01:07 PM
windows 10 version 1703
but now after replacing to timeout i am getting error invalid value for timeout(/T) specified .valid range id -1 to 9999
Created on 05-09-2017 01:09 PM - edited 08-17-2019 06:50 PM
Created 05-09-2017 02:07 PM
@wynner
i am using your template
and now it is firing after every 30 sec for 5 counts
InvokeHTTP Penalty Duration is 30 sec as per my requirement everything is in your template already but it is not working as i want to