GAE Microservices with dedicated Cron Jobs per microservice

安稳与你 提交于 2020-01-16 07:32:13

问题


Can different microservices in GAE, own dedicated cron jobs?

Background

We have written multiple services on GAE microservices application. One micronservice say Service1(default) [JAVA in GAE Standard environment] has 10 cron jobs, wheareas another microservice say, Service2 [Python in GAE Flexible environment] has 5 other cronjobs.

When we deploy both the services, cron jobs get replaced with the latest service cron jobs.

I know that Task Queue is shared resource in GAE Microservices and hence Cron jobs too may be shared. But is it impossible to let microservice have their dedicated cronjobs based on their service scope and get them uploaded on Server where all cronjobs can co-exist?

Timely response is highly appreciated.


回答1:


The cron configuration is also an application level configuration, not a module/service level one, which is why when you deploy it for one service it overwrites the previous one from another service.

You need to combine all cron jobs for all your services into a single cron configuration file and deploy that one instead, preferably using the specific cron deployment command, not by uploading it together with a particular service (sometimes that fails for multi service apps).

There are other such app level configurations as well, see https://stackoverflow.com/a/42361987/4495081



来源:https://stackoverflow.com/questions/48008198/gae-microservices-with-dedicated-cron-jobs-per-microservice

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!