【问题标题】:Google App Engine queue.yaml not working in development serverGoogle App Engine queue.yaml 在开发服务器中不起作用
【发布时间】:2017-09-24 22:31:04
【问题描述】:

我无法让 dev_appserver.py 识别我使用 queue.yaml 创建的自定义队列。它们没有出现在http://localhost:8000/taskqueue 中,当我尝试向它们添加任务时,我得到了 UnknownQueueError。它在生产环境中运行良好。

我在 Windows 10 上使用 python 2.7。

queue.yaml

total_storage_limit:5G 队列: - 名称:not-queue-a 桶大小:500 速率:10/s 重试参数: 任务重试限制:2 min_backoff_seconds:10 目标:msnot - 名称:ui-worker 目标:msbui 桶大小:200 速率:1/s 重试参数: 任务重试限制:4 min_backoff_seconds:1

我的项目结构是这样的:

|-- 根 |-- 队列.yaml |-- 索引.yaml |-- 调度.yaml |-- cron.yaml |-- 微服务1 |-- app.yaml |-- 微服务1.py |-- 微服务2 |-- app.yaml |-- 微服务1.py |-- 微服务3 |-- app.yaml |-- 微服务3.py |-- 微服务4 |-- app.yaml |-- 微服务4.py

我尝试将 queue.yaml 的副本添加到微服务子文件夹,但我仍然遇到同样的问题。我也重启了几次 dev_appserver.py。

【问题讨论】:

    标签: python google-app-engine


    【解决方案1】:

    当我将我的应用程序拆分为多个服务时,我遇到了同样的问题,dev_appserver.py 并没有完全赶上多服务应用程序。我通过符号链接每个服务中的 queue.yaml 文件来解决它:

        |-- microservice1
            |-- app.yaml            
            |-- microservice1.py
            |-- queue.yaml -> ../queue.yaml
    

    可能只有 default 服务需要,但我对此并不完全确定,我没有尝试过。

    注意:我对其他应用级配置文件应用了类似的方法。另见Can a default service/module in a Google App Engine app be a sibling of a non-default one in terms of folder structure?

    【讨论】:

    • 我不得不将 queue.yaml 复制到默认服务中进行测试,但到目前为止它确实在默认情况下工作。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-12-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-06-09
    • 2023-03-21
    相关资源
    最近更新 更多