I want to push data from Google Cloud Pub/Sub into an Apigee proxy.
I know Receiving message using push in google pubsub is the best option. Can anyone guide me?
Solved! Go to Solution.
Great question! Using Edge to consume pubsub messages is easy to setup and showcases versatility of the tool as well as the power of integration of involved technologies.
1. Go to the URL https://www.google.com/webmasters/verification of your gcp account.
2. Notice html verification file and download it.
3. Keep this page open.
1. Create push-handlers No Target proxy with proxy base path push-handlers. Passthrough. Virtual Host: Secure. Environment: test. Build and Deploy.
2. In DEVELOP add new flow with the name of the html verification file, in our case: [google8343a21f428165ca.html
3. Add Assign Message for the GET html flow to the PreFlow RESPONSE. Populate Payload with the contents of the verification file and contentType text/plain.
4. Save and Deploy the proxy.
5. At the Webmaster Central page you hopefully still have opened, click on I'm not a robot reCAPTCHA and VERIFY button.
You should receive the url is verified message
1. Create topic books
2. Press CREATE
1. In the API & Services select Credentials page. Select Domain Verification tab. Click Add domain. Add the domain URL (no protocol).
dbcedge-eval-test.apigee.net/push-handlers/
1. In the books topic's menu, select + New Subscription item.
2. Populate subscription name bookssubscription; Delivery Type: Push into an endpoint url; enter the url without protocol (https is the only expected option): dbcedge-eval-test.apigee.net/push-handlers/. Press Create button.
Your subscription is created.
1. In the Edge UI, start tracing session for the push-handlers proxy.
2. In the pubsub books topic, chose Publish message
3. Enter sample message, ie: Test message. and a sample key-value attribute: key, val. Press Publish button.
4. In the Tracing session page, you should see your messages request
5. You can see the key/val field as well as data property. As the message's data field is base64 encoded, we can use a base64 decoder to validate it: ,"data":"VGVzdCBtZXNzYWdlLg=="