[ 
https://issues.apache.org/jira/browse/NIFI-1509?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15157792#comment-15157792
 ] 

James Wing commented on NIFI-1509:
----------------------------------

I tested the code from the pull request.  The build works fine, unit tests 
pass, all contrib checks pass OK.  I did not run the integration tests, but 
used them as inspiration for my manual testing.  Everything worked great in my 
use of the PutLambda processor running against Lambda function in AWS.  Errors 
for permissions, function naming, and content formatting were all handled 
appropriately.  The function response was captured correctly.

I recommend changing the Capabilities description to make it clear the FlowFile 
content should be JSON, and the permission needed to call the Lambda function 
(as opposed to lambda:InvokeAsync and other API methods).  Maybe something like:

{quote}
Sends the FlowFile contents to a specified Amazon Lambda Function.  The 
FlowFile content must be JSON.  Requires the AWS permission 
lambda:InvokeFunction.
{quote}

And I have a question: In PutLambda.java, onTrigger method, you call 
{{context.yield()}} after catching several exceptions and transferring the 
FlowFile to the failure path, but why not in the first catch block around line 
195?  I'm asking because I don't understand and would like to learn, I have no 
basis for believing there is anything wrong with your choice.  Other processors 
I looked at were inconsistent or never called yield().

{code:title=PutLambda.java}
...
        } catch (final InvalidRequestContentException
            | InvalidParameterValueException
            | RequestTooLargeException
            | ResourceNotFoundException
            | UnsupportedMediaTypeException unrecoverableException) {
                getLogger().error("Failed to invoke lambda {} with 
unrecoverable exception {} for flow file {}",
                    new Object[]{functionName, unrecoverableException, 
flowFile});
                flowFile = populateExceptionAttributes(session, flowFile, 
unrecoverableException);
                session.transfer(flowFile, REL_FAILURE);
        } catch (final TooManyRequestsException retryableServiceException) {
            getLogger().error("Failed to invoke lambda {} with exception {} for 
flow file {}, therefore penalizing flowfile",
                new Object[]{functionName, retryableServiceException, 
flowFile});
            flowFile = populateExceptionAttributes(session, flowFile, 
retryableServiceException);
            flowFile = session.penalize(flowFile);
            session.transfer(flowFile, REL_FAILURE);
            context.yield();
...
{code}

> Support AWS Lambda Processor
> ----------------------------
>
>                 Key: NIFI-1509
>                 URL: https://issues.apache.org/jira/browse/NIFI-1509
>             Project: Apache NiFi
>          Issue Type: New Feature
>          Components: Extensions
>    Affects Versions: 0.5.0
>         Environment: all
>            Reporter: Mans Singh
>            Assignee: Mans Singh
>            Priority: Minor
>              Labels: aws, lambda, streaming
>             Fix For: 0.6.0
>
>   Original Estimate: 48h
>  Remaining Estimate: 48h
>
> Support aws lambda put processor



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to