Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

InvokeHttpProcessor - Need to retry 3 times in case of not 200's scenario.

avatar
Contributor

I have a API which I need to make a call to get the response using InvokeHttpProcessor. Incase if response status code is not 200's then I need to do a retry for 3 times ( incase of 400's and 500's). I see that I can set a retry on Failure, NO retry and Retry relationships but that is not working as expected. 
How to configure the relationships such that there I can achieve retry of 3 times on Failure, Retry and NoRetry relationships.

HttpRetry.PNG


Also is there a way to see how many retries are performed and is nifi logging this information some where?

1 ACCEPTED SOLUTION

avatar
Super Mentor

@Anderosn 

Is your InvokeHTTP processor triggered by a FlowFile from an inbound connection to the processor or does it have no inbound connections and executes purely based on configured run schedule? This is one of very few processors where an inbound connection is optional, but behavior is different dependent on the configuration chosen.  


With no inbound connection there is no FlowFile to "retry" when you encounter "failure" or "No retry" result from execution.  Because really it is retrying every time it executes essentially with no inbound connection. You could use a GenerateFlowFile processor to feed an empty trigger FlowFile to the invokeHTTP processor to trigger its execution.  This would then give you a FlowFile that Retry configuration can use.

If you found any of the suggestions/solutions provided helped you with your issue, please take a moment to login and click "Accept as Solution" on one or more of them that helped.

Thank you,
Matt

View solution in original post

1 REPLY 1

avatar
Super Mentor

@Anderosn 

Is your InvokeHTTP processor triggered by a FlowFile from an inbound connection to the processor or does it have no inbound connections and executes purely based on configured run schedule? This is one of very few processors where an inbound connection is optional, but behavior is different dependent on the configuration chosen.  


With no inbound connection there is no FlowFile to "retry" when you encounter "failure" or "No retry" result from execution.  Because really it is retrying every time it executes essentially with no inbound connection. You could use a GenerateFlowFile processor to feed an empty trigger FlowFile to the invokeHTTP processor to trigger its execution.  This would then give you a FlowFile that Retry configuration can use.

If you found any of the suggestions/solutions provided helped you with your issue, please take a moment to login and click "Accept as Solution" on one or more of them that helped.

Thank you,
Matt