Python Modules for Application Modules and Inbox

I am using App Engine modules in my python project. ( https://developers.google.com/appengine/docs/python/modules/#Python_Background_threads )

I also get emails in the m project: https://developers.google.com/appengine/docs/python/mail/receivingmail

I want to send emails to my work module, and not to the default module. To this end, my worker.yaml has the following settings

worker.yaml

api_version: 1 application: integrate module: worker version: 1-0-0 runtime: python27 threadsafe: true inbound_services: - mail builtins: - deferred: on handlers: - url: /admin/.+ script: src.worker.main.app login: admin - url: /_ah/mail/.+ script: src.worker.main.app login: admin - url: /.* script: src.worker.main.app 

app.yaml

  api_version: 1 application: integrate version: 1-0-0 runtime: python27 threadsafe: true builtins: - deferred: on handlers: - url: /admin/.+ script: src.default.main.app login: admin - url: /.* script: src.default.main.app 

I even tried adding dispatch.yaml

  application: integrate dispatch: - url: "*/_ah/mail/.+" module: worker 

But no matter what I do, emails that get into my application are processed by the module by default. Any idea what I'm missing here? I see emails coming in, but no matter what I do, they only go to the default module.

+7
google-app-engine module email channel-api
source share
2 answers

Inbound services can only be used in the default module, and this is the expected behavior. The fact that it works for you locally in devserver is actually a mistake.

+3
source share

Just additional answer information that can help people in a similar situation.

I noticed in the DevServer log:

"Skipping dispatch.yaml rules because / _ah / mail / [EMAIL_ADDRESS_FOR_APP] is not a dispatched path."

This is undoubtedly due to the local configuration.

Despite this, the workaround I am using now is:

  • Sending or directly processing incoming mail in the default module
  • Provides a script handler that creates the task, taking the appropriate MailMessage data as a payload
  • Set TaskQueue in queue.yaml to target the module you want to process the payload data, for example. "working" module
-one
source share

All Articles