Our Community is getting an upgrade! To get everything ready for the relaunch, we’ll be placing the site in read-only mode starting September 21st.
We really appreciate your understanding while we get things set up behind the scenes. Catch up on all the exciting details about the move here.
Need help or have questions? Drop us a line at [email protected]

Support Questions

Find answers, ask questions, and share your expertise
Announcements
Share your experience with Cloudera on G2 and get a $25 Amazon Gift card.
Hi, I'm CLEO! Something exciting is coming to the Community. Stay Tuned!

Routing based on exception thrown by NIFI processor

avatar
Explorer

Hi ,

 

Currently i am using NIFI to consume and publish data using kafka and i have a requirement to perform retry only for topicAuthorizationException thrown by NIFI processor (publishKafka processor).

 

Like similar to RouteonAttribute, is there any processor or any log attribute through which i can parse or read  this topicAuthorizationException error , so that i can perform retry?

 

when kafka topic does not exist, NIFI throws below exception, the same is seen in nifi-app.log, i need to know how can we read this error in NIFI

 

org.apache.kafka.common.errors.TopicAuthorizationException: Not authorized to access topics: [test_topic]

 

1 ACCEPTED SOLUTION

avatar
Master Mentor

@srilakshmi 
The PublishKafka and PublishKafkaRecord processors do not write any new attributes to the FlowFile when there is a failure.  It simply logs the failure to the nifi-app.log and routes the FlowFile to the failure relationship.  So on the FlowFile there is no unique error written that can be used for dynamic routing on failure. It could be expensive to write stack traces that come out of Client code to NiFi FlowFiles considering FlowFile attributes/metadata resides in the NiFi heap memory.

This may be a topic you want to raise in Apache NiFi jira as a feature/improvement request on these processors to get feedback from Apache NiFi community committers.

If you found that the provided solution(s) assisted you with your query, please take a moment to login and click Accept as Solution below each response that helped.

Thank you,

Matt

View solution in original post

1 REPLY 1

avatar
Master Mentor

@srilakshmi 
The PublishKafka and PublishKafkaRecord processors do not write any new attributes to the FlowFile when there is a failure.  It simply logs the failure to the nifi-app.log and routes the FlowFile to the failure relationship.  So on the FlowFile there is no unique error written that can be used for dynamic routing on failure. It could be expensive to write stack traces that come out of Client code to NiFi FlowFiles considering FlowFile attributes/metadata resides in the NiFi heap memory.

This may be a topic you want to raise in Apache NiFi jira as a feature/improvement request on these processors to get feedback from Apache NiFi community committers.

If you found that the provided solution(s) assisted you with your query, please take a moment to login and click Accept as Solution below each response that helped.

Thank you,

Matt