You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@beam.apache.org by "Beam JIRA Bot (Jira)" <ji...@apache.org> on 2020/08/09 17:07:01 UTC

[jira] [Commented] (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:comment-tabpanel&focusedCommentId=17173912#comment-17173912 ] 

Beam JIRA Bot commented on BEAM-10113:
--------------------------------------

This issue was marked "stale-P2" and has not received a public comment in 14 days. It is now automatically moved to P3. If you are still affected by it, you can comment and move it back to P2.

> 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)