egalpin commented on code in PR #22216:
URL: https://github.com/apache/beam/pull/22216#discussion_r952634696
##########
sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/pubsub/PubsubCoderProviderRegistrar.java:
##########
@@ -37,6 +37,7 @@ public List<CoderProvider> getCoderProviders() {
TypeDescriptor.of(PubsubMessage.class),
PubsubMessageWithMessageIdCoder.of()),
CoderProviders.forCoder(
TypeDescriptor.of(PubsubMessage.class),
- PubsubMessageWithAttributesAndMessageIdCoder.of()));
+ PubsubMessageWithAttributesAndMessageIdCoder.of()),
+ CoderProviders.forCoder(TypeDescriptor.of(PubsubMessage.class),
PubsubMessageCoder.of()));
Review Comment:
Thanks for the info @TheNeuralBit , this is super helpful context. Sounds
like what's here then is not going to break anything, which is the most
important.
One aspect that I predict will be confusing for users is that if one
attempts to _write_ pubsub messages with ordering key, the
`PubsubMessageWithAttributesCoder` will be used by default unless `setCoder` is
called; in that default case, the orderingKey will be "mysteriously" stripped
away by the coder. I suppose we might also need a new `write` helper method
like `writeMessagesWithOrderingKeys` in addition to `writeMessages` in order
help users to set the correct coder?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]