2

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

Ali Baig
  • 3,819
  • 4
  • 34
  • 47

1 Answers1

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.

abielita
  • 13,147
  • 2
  • 17
  • 59
  • 1
    Thank you for the reply. I was able to work it out with quite a few changes. One was, I created an azure app on SSL, added it to google webmasters, verified it from google console developer's domain verification and then tried again, I was able to save the URL for push notification. Strange that it doesn't give extra information with generic error. – Ali Baig Oct 19 '16 at 09:34
  • I tried verifying my domain like you said but am still getting the same generic:3 error. Anything else you did by any chance? – maxko87 Nov 01 '16 at 03:14
  • 1
    Make sure you are using https and not http. You have to verify the domain using google webmasters, then go to Domain verification tab on google developers console to add it to the right project. It should work then – Ali Baig Nov 01 '16 at 07:00
  • I've verified the domain with Google Webmaster Tools. I'm doing this with a Heroku app, not a Google Apps app. I don't see a way to link the domain to the google cloud app :( – maxko87 Nov 07 '16 at 22:31