ChrisSamo632 commented on a change in pull request #5504:
URL: https://github.com/apache/nifi/pull/5504#discussion_r762613284
##########
File path:
nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/src/main/java/org/apache/nifi/processors/aws/wag/InvokeAWSGatewayApi.java
##########
@@ -179,41 +182,20 @@ public void onTrigger(ProcessContext context,
ProcessSession session) throws Pro
final GenericApiGatewayClient client = getClient();
- final GenericApiGatewayRequest request = configureRequest(context,
session,
-
resourceName,
-
requestFlowFile);
-
- logRequest(logger, client.getEndpoint(), request);
final long startNanos = System.nanoTime();
- GenericApiGatewayResponse response = null;
- GenericApiGatewayException exception = null;
- try {
- response = client.execute(request);
- logResponse(logger, response);
- } catch (GenericApiGatewayException gag) {
- // ERROR response codes may come back as exceptions, 404 for
example
- exception = gag;
- }
+ final Map<String, String> attributes = requestFlowFile == null ?
Collections.emptyMap() : requestFlowFile.getAttributes();
+ final GatewayResponse gatewayResponse = invokeGateway(client,
context, session, requestFlowFile, attributes, logger);
- final int statusCode;
- if (exception != null) {
- statusCode = exception.getStatusCode();
- } else {
- statusCode = response.getHttpResponse().getStatusCode();
- }
+ GenericApiGatewayResponse response = gatewayResponse.response;
Review comment:
Looks like missing a few `final`s here (booleans below too)
--
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]