egalpin commented on code in PR #24887:
URL: https://github.com/apache/beam/pull/24887#discussion_r1179860391
##########
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 would be needed to allow for use of this coder for outgoing messages,
where the messageId field must be null to allow publishing.
--
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]