Skip to main content
jerry_pylarinos
Gold ⭐️
June 3, 2019
Solved

InvokeHTTP write a property on Failure Condition

I am working on a NIFI flow that begins with an InvokeHTTP processor.

On the occasion that there is a connection timeout (Failure condition), I wish to assign the InvokeHTTP processor Remote URL value to a new property and have this property passed as data (attribute) through the "Failure" path to another processor. Is it possible to do within the same InvokeHTTP processor?

Can anyone help?

jerry_pylarinos
Gold ⭐️
June 19, 2019

I solved this by using a GenerateFlowFile processor to create an attribute url and to trigger the InvokeHTTP processor at the schedule rate of interest.
On a failure condition (e.g. InvokeHTTP connection timeout) I use an UpdateAttribute processor to assign to the attribute url the Remote URL using a Regex: ${invokehttp.java.exception.message:substringAfterLast('/'):substringBefore(':')}

1 reply

jerry_pylarinos
jerry_pylarinosAuthorAnswer
Gold ⭐️
June 19, 2019

I solved this by using a GenerateFlowFile processor to create an attribute url and to trigger the InvokeHTTP processor at the schedule rate of interest.
On a failure condition (e.g. InvokeHTTP connection timeout) I use an UpdateAttribute processor to assign to the attribute url the Remote URL using a Regex: ${invokehttp.java.exception.message:substringAfterLast('/'):substringBefore(':')}

Translate