【问题标题】:How to add an item into Google Cloud Tasks queue in Java?如何在 Java 中将项目添加到 Google Cloud Tasks 队列中?
【发布时间】:2019-03-25 06:16:41
【问题描述】:

谁能给我一个提示,如何在 Java 中将项目添加到 Google Cloud Tasks 队列中? https://cloud.google.com/tasks/docs/

Google 对其队列 v1 https://cloud.google.com/appengine/docs/standard/java/taskqueue/pull/creating-tasks 的描述非常流畅,但对于新的 beta 版 Google Cloud Tasks 则没有类似的描述。

我只需要将一个项目添加到具有特定标签的队列中,然后通过oldest_tag() 函数将其从队列中拉出。

有人使用过 Google Cloud Tasks 吗?

【问题讨论】:

    标签: java google-app-engine google-cloud-platform google-cloud-tools


    【解决方案1】:

    您引用的 v1 文档页面特定于 pull queues,Cloud Tasks 不(至少)不支持。

    来自The App Engine SDK versus the Cloud Tasks API(强调我的):

    某些功能尚无法通过 Cloud Tasks API 使用:

    【讨论】:

    • 打扰一下,您的意思是现在我们不能将 Cloud Tasks 用作队列吗?
    • 作为push queue 是的,作为拉队列号。
    • @DanCornilescu 我理解正确吗,Pull Queues 将在 2 月停用,而 Google 还没有替代产品?谷歌的文档确实很模糊。如果他们真的需要拉队列,你是否偶然知道开发人员应该做什么?
    • 您在哪里看到 Pull Queues 将在 2 月停用?
    【解决方案2】:

    有两种不同的方式来访问任务服务:

    • 使用 App Engine SDK(App Engine 标准第一代运行时)
    • 使用处于测试阶段的 Cloud Tasks API(其他所有机构,尤其是第二代运行时,如 Python 3.7 或 App Engine flex)。有可用的基于 REST 或 gRPC 的 API。目前,Cloud Tasks API 仅支持推送类型的队列。 Cloud Pub/Sub API 可用于许多拉取队列类型的用例。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2020-03-11
      • 1970-01-01
      • 2017-10-25
      • 2019-04-11
      • 1970-01-01
      • 1970-01-01
      • 2021-12-05
      相关资源
      最近更新 更多