0

When we create an subscription in Cloud Pub Sub we have the ability to enable ordering of messages. However, when a subscription is created through EventArc, there is no option to enable ordering. Once the subscription is created, it is not possible to enable ordering.How can we enable ordering in cloud pub sub subscription created via EventARc trigger ?

vzurd
  • 1,416
  • 2
  • 15
  • 37

2 Answers2

0

The short answer is NO.

However, you have to understand what is ordering feature on PubSub. Pubsub is able to send message in order only on the same ordering-key. It's, in general, the case when you have message related to the same thing (for example to the same IoT device).

In the case of eventarc, that bases the PubSub message on the audit logs, what could be the ordering key? The account email? What would you like?

guillaume blaquiere
  • 66,369
  • 2
  • 47
  • 76
  • I was concerned more on of order in terms of time, meaning message that came earlier should be processed earlier. As the eventarc is based on audit logs, I am assuming that it is a given, as audits are ordered by time. I don't have any other key for ordering at the moment. – vzurd Mar 25 '21 at 22:18
  • In this case, and most of the time (not guaranteed, but in normal condition, without outage) the message are delivered in order of creation (so according to the time of creation). However, in case of you have an issue in the processing, and the message need to be re-submitted, the order is not kept. – guillaume blaquiere Mar 25 '21 at 22:29
  • Eventarc does not use Audit Log queries for PubSub triggers https://cloud.google.com/eventarc/docs/overview, so in theory, it's possible for Google to enable it, but it's quite hard mainly because it's not a gRPC streaming in this case, but a bunch of stateless independent HTTP calls. – Alexey Zimarev Jul 27 '21 at 20:22
  • @guillaumeblaquiere what if I want to use an ID from my data as ordering key ? – vzurd Aug 13 '21 at 03:11
  • In this case, you need to get the message as is, and to republish it with the ordering key of your choice in a new topic. There isn't an automatic translation. – guillaume blaquiere Aug 13 '21 at 07:38
0

feel free to open a feature request if event ordering is important for your use case: https://issuetracker.google.com/issues/new?component=1030474&template=0

Mete Atamel
  • 821
  • 5
  • 11