简体   繁体   中英

Google Cloud Run + Django + RabbitMQ (or another message broker)

I have a contenerized Django application, which I deployed on Google Cloud Run . For the most time no requests are made to the app, so GCP can reduce it to 0 instances (and the billing is small). Some requests provide time consuming tasks and I need to handover them to another service by RabbitMQ (or possibly another message broker). I wanted to use pika at the Django app side, but if I understand correctly it forces it to be running all the time.

So is there a solution, where I can pass messages to message broker from Django app and also listen to message queue, but the app can reduce to 0 instances when the queue is empty (and increase instances if it's not)?

Thanks

A good consideration would be to use Google Cloud Tasks and Google Cloud Scheduler.

I found this tutorial useful

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM