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

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

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

    https://github.com/apache/nifi/pull/2859#discussion_r204808680
  
    --- Diff: 
nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/src/main/java/org/apache/nifi/processors/aws/sqs/PutSQS.java
 ---
    @@ -115,7 +125,19 @@ public void onTrigger(final ProcessContext context, 
final ProcessSession session
             entry.setId(flowFile.getAttribute("uuid"));
             final ByteArrayOutputStream baos = new ByteArrayOutputStream();
             session.exportTo(flowFile, baos);
    -        final String flowFileContent = baos.toString();
    +
    +        final Charset charset = 
Charset.forName(context.getProperty(CHARSET).getValue());
    +
    +        String flowFileContent;
    +
    +        // Get the content of the FlowFile with the given Charset. Fall 
back to the default charset
    +        // if the given charset is not supported.
    +        try {
    +            flowFileContent = baos.toString(charset.name());
    +        } catch (UnsupportedEncodingException e) {
    --- End diff --
    
    I like the second alternative. Haven't meet the `customValidate` validate 
yet. Where does it come from?


> PutSQS not UTF-8 encoding output
> --------------------------------
>
>                 Key: NIFI-4802
>                 URL: https://issues.apache.org/jira/browse/NIFI-4802
>             Project: Apache NiFi
>          Issue Type: Bug
>          Components: Extensions
>    Affects Versions: 1.4.0
>         Environment: OSX, Linux
>            Reporter: Richard St. John
>            Priority: Major
>
> PutSQS processor does not properly encode content.  Line 117 reads, 
> {code:java}
> final string flowFileContent = baos.toString();
> {code}
> Instead, the output stream should default to UTF-8, or have a configuration 
> similar to GetSQS.



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

Reply via email to