You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@nifi.apache.org by Mark Payne <ma...@hotmail.com> on 2015/02/15 20:56:35 UTC
Re: Delivery Status Notification (Failure)
Toivo,
There are a few ways to tackle this.
You can do essentially what you’re discussing here with the RouteOnAttribute and UpdateAtribute Processors. On failure, you can route to UpdateAttribute. In UpdateAttribute, add a property named “retryCount” and a value of “${retryCount:replaceNull(0):plus(1)}”. Then send that to RouteOnAttribute. RouteOnAttribute has a property added named “retry” with a value of “${retryCount:le(3)}”. Then, you connect the “retry” relationship back to your processor and route “unmatched” to wherever you want to go if you’ve finished retrying.
Alternatively, you could just RouteOnAttribute and add a property named “retry” with a value of “${now():minus( ${entryDate} ):lt( 300000 )}”, which tells it to send to retry if the FlowFile is less than 5 minutes old. Then you don’t need to increment anything but you retry for 5 minutes rather than retrying up to 3 times.
Also, Jenn Barnabee, one of the contributors, has a blog where she’s written a lot of stuff about how to do little tasks like this in NiFi. She illustrates a similar method for doing this here: https://kisstechdocs.wordpress.com/2015/01/15/creating-a-limited-failure-loop-in-nifi/
Really, we should probably consider making this simpler by having a CountRetries processors that has two relationships: “Retry”, “No More Retries” and just lets you configure Proc A (failure) -> CountRetries (Retry) -> Proc A and CountRetries (No More Retries) -> elsewhere.
Thanks
-Mark
From: postmaster@mail.hotmail.com
Sent: Sunday, February 15, 2015 2:56 PM
To: Mark Payne
This is an automatically generated Delivery Status Notification.
Delivery to the following recipients failed.
dev@nifi.incubator.apache.org
Re: Delivery Status Notification (Failure)
Posted by Toivo Adams <to...@gmail.com>.
Thank you for hints, I will check out and do little experiments.
Meanwhile I sent next scenario to Route Based on Result topic.
toivo
--
View this message in context: http://apache-nifi-incubating-developer-list.39713.n7.nabble.com/Re-Delivery-Status-Notification-Failure-tp694p696.html
Sent from the Apache NiFi (incubating) Developer List mailing list archive at Nabble.com.