Skip to content

Can not publish pubsub message with ordering key #30766

@TRUSTMEIMJEDI

Description

@TRUSTMEIMJEDI

https://github.com/apache/beam/blame/7f04c4f07f2698f823953902bfb79fc7cb6e1584/sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/pubsub/PubsubIO.java#L1480

Because of this code it is not possible to send pubsub message with ordering key due to the fact that coder that is provided from input is then overridden by line 1480. This problem occurs since 2.48 version in version 2.47 everything is fine.

Doesn't matter if coder is registered explicitly
like this
.setCoder(PubsubMessageWithAttributesAndMessageIdAndOrderingKeyCoder.of())
or like this
pipeline.getCoderRegistry().registerCoderForClass(PubsubMessage.class, PubsubMessageWithAttributesAndMessageIdAndOrderingKeyCoder.of());

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions