2017-09-24 143 views
1

我无法让dev_appserver.py识别使用queue.yaml创建的自定义队列。他们不出现在http://localhost:8000/taskqueue,当我尝试向他们添加任务时,我得到UnknownQueueError。它在生产环境中工作正常。Google App Engine queue.yaml无法在开发服务器上工作

我使用python 2.7在Windows 10

queue.yaml中

 
total_storage_limit: 5G 
queue: 
- name: not-queue-a 
    bucket_size: 500 
    rate: 10/s 
    retry_parameters: 
    task_retry_limit: 2 
    min_backoff_seconds: 10 
    target: msnot 
- name: ui-worker 
    target: msbui 
    bucket_size: 200 
    rate: 1/s 
    retry_parameters: 
    task_retry_limit: 4 
    min_backoff_seconds: 1 

我的项目结构是这样的:

 
    |-- root 
     |-- queue.yaml 
     |-- index.yaml 
     |-- dispatch.yaml 
     |-- cron.yaml 
     |-- microservice1 
      |-- app.yaml 
      |-- microservice1.py 
     |-- microservice2 
      |-- app.yaml 
      |-- microservice1.py 
     |-- microservice3 
      |-- app.yaml 
      |-- microservice3.py 
     |-- microservice4 
      |-- app.yaml 
      |-- microservice4.py 

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

回答

0

当我将应用程序分成多个服务时,我遇到了同样的问题,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?

相关问题