You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@beam.apache.org by "Jeff Webb (Jira)" <ji...@apache.org> on 2021/09/14 23:08:00 UTC

[jira] [Updated] (BEAM-10113) PubSubIO readMessagesWithMessageId() breaks the payload encoding when using DataflowRunner

     [ https://issues.apache.org/jira/browse/BEAM-10113?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jeff Webb updated BEAM-10113:
-----------------------------
    Status: Open  (was: Triage Needed)

> 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.3.4#803005)