Support Questions

Find answers, ask questions, and share your expertise

InvokeHTTP write a property on Failure Condition

avatar

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?

1 ACCEPTED SOLUTION

avatar

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(':')}

View solution in original post

1 REPLY 1

avatar

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(':')}