n-oden commented on a change in pull request #14767:
URL: https://github.com/apache/beam/pull/14767#discussion_r630142557



##########
File path: sdks/python/apache_beam/io/gcp/pubsub.py
##########
@@ -294,6 +327,9 @@ def message_to_proto_str(element):
       raise TypeError(
           'Unexpected element. Type: %s (expected: PubsubMessage), '
           'value: %r' % (type(element), element))
+    # message_id and publish_time cannot be written back to pubsub

Review comment:
       My understanding is that yes, pubsub will reject the message.  
https://cloud.google.com/pubsub/docs/reference/rpc/google.pubsub.v1#pubsubmessage
 says, in re both fields:
   
   > It must not be populated by the publisher in a Publish call.
   
   Fair question about copying vs mutating, and I maybe don't know enough about 
beam's internals to have a real answer? Logically WriteToPubsub is (I think) 
going to be the end of the line for the message since it doesn't return a 
pcollection, but is the message purely in local state here, or does mutating it 
potentially change it in-flight for other transforms that might be processing 
it via other routes at the same time?




-- 
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.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to