exceptionfactory commented on code in PR #7955:
URL: https://github.com/apache/nifi/pull/7955#discussion_r1377641918
##########
nifi-nar-bundles/nifi-kafka-bundle/nifi-kafka-2-6-processors/src/main/java/org/apache/nifi/processors/kafka/pubsub/PublishKafkaRecord_2_6.java:
##########
@@ -585,6 +586,10 @@ public void onTrigger(final ProcessContext context, final
ProcessSession session
failureStrategy.routeFlowFiles(session, flowFiles);
context.yield();
}
+ } catch (final KafkaException e) {
+ getLogger().error("Failed to obtain Kafka publisher; will yield
Processor", e);
Review Comment:
One approach could be wrapping the `PublisherPool.obtainPublisher()` method
in a separate method with the try-catch, and the return of that method takes
the place of the current direct call to `obtainPublisher`. That separate method
also needs to take into account the configured `Failure Strategy` and call that
strategy method.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]