Closed pedrorjbr closed 5 months ago
Is it possible to publish a message using ordering_key? this code is from pubsub library gcp.
publisher_options = pubsub.types.PublisherOptions( enable_message_ordering=enable_message_ordering ) self.publisher = pubsub.PublisherClient(publisher_options=publisher_options) future = self.publisher.publish( topic=topic_path, data=data, ordering_key=ordering_key )
Yes indeed, the PubsubMessage constructor takes an ordering_key as a parameter, setting it there when crafting the message should do the trick.
PubsubMessage
ordering_key
Is it possible to publish a message using ordering_key? this code is from pubsub library gcp.