问题描述
我发现任务队列主要用于App Engine标准环境.我正在将现有服务从App Engine迁移到Kubernetes.什么是任务队列的好选择?推送队列是当前正在使用的队列.
I found out that the task queue is being primarily used for App Engine standard environment. I am migrating our existing services from App Engine to Kubernetes. What would be a good alternative for task queue? Push queue is the one which is being currently used.
我在线阅读文档,也通过以下链接阅读:何时使用PubSub与任务队列但是对于在Kubernetes上Pub/Sub是否是一个很好的替代方案,还没有明确的答案.
I read documentation online as well as gone through this link: When to use PubSub vs Task QueuesBut there is no clear answer as to whether Pub/Sub is a good alternative on Kubernetes.
我当前的用例是,服务对一组ID执行相似的任务,而某些任务则需要花费一些时间才能完成,因此队列将承担此任务并对其进行处理,同时服务可以并行执行其他任务.尽管在这里有发布者和订阅者的地方主要需要发布/订阅,但是服务本身具有一些任务,需要并行处理!
My current use case is that a service performs similar tasks for a set of ID's and some task which takes some time to complete so the queue would take this task and process it while the service can perform other things in parallel. While Pub/Sub is mainly needed where we have publisher and subscriber here the service itself has some tasks which it needs to keep processing in parallel!
推荐答案
我认为 Cloud Pub/Sub 是用于消息队列的出色工具.无论是通过Kubernetes还是其他方式,它都与您如何部署/运行服务正交.
I would think Cloud Pub/Sub is a great tool for message queues. It's orthogonal to how you deploy/run your services, whether with Kubernetes or something else.
在GCP上有很多与Kubernetes一起使用pubsub的相关文档,例如此页面.
There's a lot of relevant documentation for using pubsub with Kubernetes on GCP, like this page.
这篇关于替代Google Cloud Kubernetes上的任务队列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!