I created a POST endpoint in the appengine flexible environment (Java/Spring Boot). It is in the same Google project as the PubSub subscriptions. I checked and this POST endpoint is accessible from outside world. I can post data to this endpoint using Postman from my local PC. But my controller does not get the requests from the push subscription.
I tried the simple endpoint urls like /push and also the recommended urls like /_ah/push-handlers/push but the results are the same.
I can see in the Stackdriver logs a lot of messages:
{
metadata: {
projectId: "myproject"
serviceName: "appengine.googleapis.com"
zone: "us-central1-b"
labels: {…}
timestamp: "2016-12-06T19:17:51.922Z"
}
insertId: "1u1o1hqf77guah"
log: "appengine.googleapis.com/nginx.request"
structPayload: {
method: "POST"
latencySeconds: "0.000"
referer: "-"
host: "-"
user: "-"
code: "307"
remote: "130.211.3.227"
agent: "-"
path: "/push"
size: "180"
}
}
But my push controller is never called.
When I post to this URL from Postman, I get similar 307 redirect (the only difference in the agent) and then after my controller responds I can see the 200 response:
{
metadata: {
projectId: "myproject"
serviceName: "appengine.googleapis.com"
zone: "us-central1-b"
labels: {…}
timestamp: "2016-12-06T19:10:14.226Z"
}
insertId: "1acos4zf74fb5r"
log: "appengine.googleapis.com/nginx.request"
structPayload: {
method: "POST"
latencySeconds: "0.035"
referer: "-"
host: "-"
user: "-"
code: "200"
remote: "130.211.0.196"
agent: "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.99 Safari/537.36"
path: "/push"
size: "727"
}
}
Here is my app.yaml
# [START appyaml]
runtime: java
env: flex
runtime_config:
jdk: openjdk8
manual_scaling:
instances: 1
handlers:
- url: /.*
script: this field is required, but ignored
secure: optional
# [END appyaml]
What can be wrong?