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

ASF GitHub Bot commented on NIFI-4786:
--------------------------------------

Github user jvwing commented on a diff in the pull request:

    https://github.com/apache/nifi/pull/2409#discussion_r162796710
  
    --- Diff: 
nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/src/main/java/org/apache/nifi/processors/aws/kinesis/stream/PutKinesisStream.java
 ---
    @@ -111,64 +112,80 @@ public void onTrigger(final ProcessContext context, 
final ProcessSession session
                 for (int i = 0; i < flowFiles.size(); i++) {
                     FlowFile flowFile = flowFiles.get(i);
     
    +                String streamName = 
context.getProperty(KINESIS_STREAM_NAME).evaluateAttributeExpressions(flowFile).getValue();;
    +
                     final ByteArrayOutputStream baos = new 
ByteArrayOutputStream();
                     session.exportTo(flowFile, baos);
                     PutRecordsRequestEntry record = new 
PutRecordsRequestEntry().withData(ByteBuffer.wrap(baos.toByteArray()));
     
                     String partitionKey = 
context.getProperty(PutKinesisStream.KINESIS_PARTITION_KEY)
    -                    
.evaluateAttributeExpressions(flowFiles.get(i)).getValue();
    +                        
.evaluateAttributeExpressions(flowFiles.get(i)).getValue();
     
                     if ( ! StringUtils.isBlank(partitionKey) ) {
                         record.setPartitionKey(partitionKey);
                     } else {
                         
record.setPartitionKey(Integer.toString(randomParitionKeyGenerator.nextInt()));
                     }
     
    -                records.add(record);
    +                if ( !recordHash.containsKey(streamName) ) {
    --- End diff --
    
    Would you also please fix these `if`s?  I completely understand they were 
already that way.


> Allow Expression Evaluation to Kinesis/Firehose Stream Name
> -----------------------------------------------------------
>
>                 Key: NIFI-4786
>                 URL: https://issues.apache.org/jira/browse/NIFI-4786
>             Project: Apache NiFi
>          Issue Type: Improvement
>          Components: Extensions
>    Affects Versions: 1.5.0
>            Reporter: Dorian Bugeja
>            Priority: Minor
>              Labels: features, performance, pull-request-available
>         Attachments: 
> NIFI_4786___Allow_Expression_Evaluation_to_Kinesis_Firehose_Stream_Name_NIFI_4786___Allow_1.patch
>
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> Currenctly, the Stream name propoerty for both Firehose and Kinesis does not 
> support the expression language. Routing can be performed based on an 
> attribute of the flowfile and having a single component rather than multiple 
> for each one. 



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to