You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beam.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2017/07/18 01:34:00 UTC

[jira] [Commented] (BEAM-2629) Adding timestamp and id attributes to pubsub messages with no other attributes causes an exception.

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

ASF GitHub Bot commented on BEAM-2629:
--------------------------------------

GitHub user nkilmer opened a pull request:

    https://github.com/apache/beam/pull/3581

    [BEAM-2629] Fixed adding timestamp and id attributes to pubsub messages

    See the writeup here: https://issues.apache.org/jira/browse/BEAM-2629

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/nkilmer/beam pubsub-attribute-fix

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/beam/pull/3581.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #3581
    
----
commit e50e5f6b56eee3acaa17ebb7b840a942ac178c6a
Author: Nigel Kilmer <nk...@google.com>
Date:   2017-07-18T01:09:57Z

    Fixed adding timestamp and id attributes to pubsub messages

----


> Adding timestamp and id attributes to pubsub messages with no other attributes causes an exception.
> ---------------------------------------------------------------------------------------------------
>
>                 Key: BEAM-2629
>                 URL: https://issues.apache.org/jira/browse/BEAM-2629
>             Project: Beam
>          Issue Type: Bug
>          Components: sdk-java-gcp
>    Affects Versions: 2.2.0
>            Reporter: Nigel Kilmer
>            Assignee: Nigel Kilmer
>
> I'm trying to use PubsubIO.writeProtos along with a timestamp and id attribute. When PubsubIO tries to write the messages to my topic, it throws a PipelineExecutionException with this cause:
> Caused by: java.lang.UnsupportedOperationException
> 	at java.util.AbstractMap.put(AbstractMap.java:209)
> 	at org.apache.beam.sdk.io.gcp.pubsub.PubsubJsonClient.publish(PubsubJsonClient.java:148)
> 	at org.apache.beam.sdk.io.gcp.pubsub.PubsubUnboundedSink$WriterFn.publishBatch(PubsubUnboundedSink.java:249)
> 	at org.apache.beam.sdk.io.gcp.pubsub.PubsubUnboundedSink$WriterFn.processElement(PubsubUnboundedSink.java:285)
> Looks like the problem is that PubsubJsonClient attempts to add the timestamp and id attributes to a map which may be empty and immutable if no other attributes are specified on the message. I will submit a pull request with a fix for this bug shortly.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)