You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by GitBox <gi...@apache.org> on 2023/01/04 23:21:48 UTC

[GitHub] [beam] apilloud commented on a diff in pull request #24887: Sets PubsubMessageWithAttributesAndMessageIdAndOrderingKeyCoder as default coder for all PubsubMessage

apilloud commented on code in PR #24887:
URL: https://github.com/apache/beam/pull/24887#discussion_r1061964917


##########
sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/pubsub/PubsubMessageWithAttributesAndMessageIdAndOrderingKeyCoder.java:
##########
@@ -42,8 +42,9 @@
   // A message's attributes can be null.
   private static final Coder<Map<String, String>> ATTRIBUTES_CODER =
       NullableCoder.of(MapCoder.of(StringUtf8Coder.of(), StringUtf8Coder.of()));
-  // A message's messageId cannot be null
-  private static final Coder<String> MESSAGE_ID_CODER = StringUtf8Coder.of();
+  // A message's messageId can only be null when the message is an outgoing message (i.e. to be
+  // published). Incoming messages will always have a non-null messageId
+  private static final Coder<String> MESSAGE_ID_CODER = NullableCoder.of(StringUtf8Coder.of());

Review Comment:
   This is a breaking change as it adds a byte to the encoded message. Why is it needed?



-- 
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: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org