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

Danny McCormick commented on BEAM-10113:
----------------------------------------

This issue has been migrated to https://github.com/apache/beam/issues/20246

> PubSubIO readMessagesWithMessageId() breaks the payload encoding when using 
> DataflowRunner
> ------------------------------------------------------------------------------------------
>
>                 Key: BEAM-10113
>                 URL: https://issues.apache.org/jira/browse/BEAM-10113
>             Project: Beam
>          Issue Type: Bug
>          Components: io-java-gcp
>    Affects Versions: 2.20.0
>         Environment: Running locally on MacOS Catalina 10.15.4 and as a 
> Dataflow job in GCP.
>            Reporter: Alexander Malyga
>            Priority: P3
>              Labels: GCP, dataflow, pubsubio, runner
>             Fix For: Not applicable
>
>
> My pipeline reads PubSub messages and parses their payload to objects using 
> Gson. I use PubsubIO.readMessagesWithMessageId() to get the PubSub message 
> and the message ID.
> I tested the pipeline thoroughly by running it with the DirectRunner in my 
> local machine and everything works fine, but when running it as a Dataflow 
> job in GCP using the DataflowRunner, Gson can't parse the messages properly 
> because the first character of the payload (opening bracket "{") is missing, 
> this only happens when using the DataflowRunner. 
> I noticed that the problem no longer happens when using 
> PubsubIO.readStrings() instead of PubsubIO.readMessagesWithMessageId() and 
> getting the payload directly (previously I had to decode the payload using 
> new String(element.getPayload(), StandardCharsets.UTF_8); )
>  
>  



--
This message was sent by Atlassian Jira
(v8.20.7#820007)

Reply via email to