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/09/29 15:54:53 UTC

[GitHub] [nifi] turcsanyip commented on a change in pull request #5419: NIFI-9255: Support asynchronous session commits in ListenHTTP

turcsanyip commented on a change in pull request #5419:
URL: https://github.com/apache/nifi/pull/5419#discussion_r718662407



##########
File path: nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/servlets/ListenHTTPServlet.java
##########
@@ -413,12 +414,20 @@ protected void proceedFlow(final HttpServletRequest request, final HttpServletRe
                     new Object[]{flowFileSet, request.getRemoteHost(), request.getRemotePort(), foundSubject, foundIssuer, flowFileSet.size(), uuid});
             }
         } else {
-            response.setStatus(this.returnCode);
             logger.info("Received from Remote Host: [{}] Port [{}] SubjectDN [{}] IssuerDN [{}]; transferring to 'success'",
                 new Object[]{request.getRemoteHost(), request.getRemotePort(), foundSubject, foundIssuer});
 
             session.transfer(flowFileSet, ListenHTTP.RELATIONSHIP_SUCCESS);
-            session.commitAsync();
+
+            final AsyncContext asyncContext = request.startAsync();
+            session.commitAsync(() -> {
+                        response.setStatus(this.returnCode);
+                        asyncContext.complete();
+                    }, t -> {
+                        response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);

Review comment:
       @exceptionfactory Added the error logging. Thanks!




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