You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by "gresockj (via GitHub)" <gi...@apache.org> on 2023/09/04 15:14:29 UTC

[GitHub] [nifi] gresockj commented on a diff in pull request #7529: NIFI-8531: Upgrading Kinesis processors to AWS SDK 2.x

gresockj commented on code in PR #7529:
URL: https://github.com/apache/nifi/pull/7529#discussion_r1315053274


##########
nifi-nar-bundles/nifi-aws-bundle/nifi-aws-abstract-processors/src/main/java/org/apache/nifi/processors/aws/v2/AbstractAwsProcessor.java:
##########
@@ -192,6 +181,28 @@ public abstract class AbstractAwsProcessor<T extends SdkClient, U extends AwsSyn
 
     private final AwsClientCache<T> awsClientCache = new AwsClientCache<>();
 
+    /*
+     * Allow optional override of onTrigger with the ProcessSessionFactory where required for AWS processors (e.g. ConsumeKinesisStream)
+     *
+     * @see AbstractProcessor
+     */
+    @Override
+    public void onTrigger(final ProcessContext context, final ProcessSessionFactory sessionFactory) throws ProcessException {
+        final ProcessSession session = sessionFactory.createSession();
+        try {
+            onTrigger(context, session);
+            session.commitAsync();
+        } catch (final Throwable t) {

Review Comment:
   I see your point, but this was derived from `AbstractProcessor#onTrigger`, which also catches `Throwable`, so I'm inclined to leave it as is.



-- 
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