I created a Google Pub/Sub push subscription which points to a Google App Engine endpoint, but GAE is not receiving anything.
The messages are being published (I can see it on the Pub/Sub console), but never acknowledged.
The endpoint URL should be correct since I made my GAE endpoint public and tested using Postman.
Does Google Pub/Sub not support calling Google App Engine endpoints? Or I'm I missing something here?
Appreciate it someone could help with this.
For a message to be acknowledged, it means it has to be received by the subscriber. How are you trying to do this? I ask because GAE (at least GAE standard) doesn't support streaming which means you can't have an indefinitely open connection listening for messages from pubsub.
Yes Google Pub/Sub supports calling to Google App Engine endpoints. I referred to this documentation .
As per the document, I used App Engine Flex Environment with Pub/Sub push subscription and I am able to fetch the messages that were published from Pub/Sub to the endpoint.
You can refer to the below mentioned steps :
Demo→
app.yaml
requirements.txt
main.py
templates→
index.html
env_variables:
PUBSUB_TOPIC: your-topic
PUBSUB_VERIFICATION_TOKEN: 1234abcd
https://PROJECT_ID.REGION_ID.r.appspot.com
https://mydemoproject.uc.r.appspot.com
https://mydemoproject.uc.r.appspot.com/pubsub/push?token=1234abcd
When an application is deployed in App Engine we can access that application at - https://PROJECT_ID.REGION_ID.r.appspot.com
The messages will be received by any of the instances of your application deployed in App Engine.
SSH into your instances and use the App Engine endpoint URL in the VM.
Output of instance 1:
Output of instance 2:
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.