Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GCP Pub/Sub priority queue

I have pub/sub topics, a pull subscriptions and a data pipelines that pull messages using python and NodeJS implementation of the GCP pub/sub library.

I have an endless regular streaming workload and ad-hoc workloads. I want to prioritize the ad-hoc workloads immediately when needed.

How do I do that?

Creating an additional pub/sub topic for each pipeline seems like a wrong solution. There must be another way to prioritize ad-hoc workloads.

like image 604
stkvtflw Avatar asked Dec 05 '25 16:12

stkvtflw


1 Answers

As mentioned in this stackoverflow thread, Pub/Sub does not provide any mechanism to prioritise a message. Moreover this feature would come into picture if the subscribers are not able to keep up with the publishing rate which is resulting in high backlog messages. If subscribers are keeping up and processing and acking messages quickly, then the notion of "priority" messages isn't really necessary.

If a backlog is being built up and some messages needs to be processed with higher priority, then you can consider creating a different "high-priority" topic and subscription. The subscribers subscribe to this subscription as well as the "normal" subscription and prioritize processing messages from the "high-priority" subscription whenever they arrive.

like image 104
Sakshi Gatyan Avatar answered Dec 08 '25 15:12

Sakshi Gatyan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!