1
我開始將應用拆分爲兩個模塊,併成功將應用在App Engine上運行。我可以通過使用模塊/版本特定的URL來驗證新的配置來驅動流量,並查看無誤地處理的請求和任務隊列事件。dispatch.yaml在默認生產環境下不適用於任務隊列
例如,使用 - http://micro-services.msn-transit-api.appspot.com - 正確將流量驅動到新的非默認版本。
然而,當我更新的GAE控制檯默認版本,應該被分派到一個新的模塊請求不正確的路由。它們被分派到默認模塊,並失敗,因爲端點已經移動。
就好像dispatch.yaml未激活。
默認應用YAML文件:
application: msn-transit-api
module: default
version: micro-services
runtime: python27
api_version: 1
threadsafe: true
instance_class: F1
automatic_scaling:
min_idle_instances: 3
新的模塊YAML文件:
application: msn-transit-api
module: stats-and-maps
version: micro-services
runtime: python27
api_version: 1
threadsafe: true
instance_class: B1
basic_scaling:
max_instances: 1
handlers:
# map apps
- url: /map(.*)
script: stats_and_maps.maps.map.app
# stats task
- url: /stats/new/.*
script: stats_and_maps.stats.stathat.application
調度YAML:
dispatch:
- url: "*/map*"
module: stats-and-maps
- url: "*/stats/*"
module: stats-and-maps
值得一提的是,這是失敗的端點被任務隊列中的作業擊中。
爲什麼會默認GAE上的版本改變其行爲?