问题
I am working with pub/sub for the first time and its quite confusing. I just want to receive push notifications on my MVC application whenever I receive an email on gmail account. I have setup the project id (enabled pub/sub API), created a topic with permissions (gmail-api-push@system.gserviceaccount.com) and added a subscriber to that topic, everything from console.cloud.google.com as I don't think I need to setup these from my code everytime. I am trying to set the delivery type to 'Push into an endpoint URL' with the URL of my choice (I tried to setup localhost/home, also with SSL, then one of my online domains for testing) but keep getting this "generic:3" error on bottom-left. I don't want to use 'Pull' each time as the delivery type.
There isn't a lot of help on this apart from developers.google.com but I'm not getting the reason for this error. Any help would be highly appreciated
回答1:
Based from this documentation, if you want to push notifications when there are changes to Gmail mailboxes, you need to use the Cloud Pub/Sub API. Be noted that in push delivery, the Pub/Sub server sends a request to the subscriber application, at a preconfigured endpoint. The subscriber's HTTP response serves as an implicit acknowledgement: a success response indicates that the message has been successfully processed and the Pub/Sub system can delete it from the subscription; a non-success response indicates that the Pub/Sub server should resend it.
Usually, generic error occurs when a transaction fails. By default, the API Gateway returns a very basic error to the client when a message filter fails. You can try the workaround in this forum.
来源:https://stackoverflow.com/questions/40099785/generic3-push-into-an-endpoint-url-pubsub-api-for-gmail