You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by GitBox <gi...@apache.org> on 2021/07/30 17:56:10 UTC

[GitHub] [nifi] naddym commented on a change in pull request #5254: NIFI-8950: Added ability to optionally use a file-system backed Conte…

naddym commented on a change in pull request #5254:
URL: https://github.com/apache/nifi/pull/5254#discussion_r680126091



##########
File path: nifi-external/nifi-kafka-connect/nifi-kafka-connector/src/main/java/org/apache/nifi/kafka/connect/StatelessNiFiSourceTask.java
##########
@@ -174,10 +174,17 @@ public void start(final Map<String, String> properties) {
             partitionMap = clusterStatePartitionMap;
         }
 
-        for (final FlowFile flowFile : outputFlowFiles) {
-            final byte[] contents = triggerResult.readContent(flowFile);
-            final SourceRecord sourceRecord = createSourceRecord(flowFile, contents, componentState, partitionMap);
-            sourceRecords.add(sourceRecord);
+        try {
+            for (final FlowFile flowFile : outputFlowFiles) {
+                final byte[] contents = triggerResult.readContent(flowFile);
+                final SourceRecord sourceRecord = createSourceRecord(flowFile, contents, componentState, partitionMap);
+                sourceRecords.add(sourceRecord);
+            }
+        } catch (final Exception e) {
+            logger.error("Failed to obtain contents of Output FlowFiles in order to form Kafka Record", e);
+            triggerResult.abort(e);
+            failureYieldExpiration = System.currentTimeMillis() + 1000L; // delay next execution for 1 second to avoid constnatly failing and utilization huge amounts of resources

Review comment:
       Just to heads up, small typo in comment, should be `constantly` instead of `constnatly`




-- 
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: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org