Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Implementing an Event Driven Framework with Apigee

Hi,

I'm trying to create a framework in which, if a proxy is triggered by the backend, the proxy uses the callback URLs in all the Apps which have subscribed to a specific Product, to push the data received - a typical webhooks design. This way all Developers can create Apps and associate it with the WebHooks Product to get data for the subscribed event without the backend or the proxy being made aware of the same.

I can achieve the same using Management APS as below:

  1. Get a list of all App Ids using: /v1/organizations/{org name}/apps
  2. Iterate through each of the Apps and get its respective details using : /v1/organizations/{org name}/apps/{app id}
  3. Get the callback URL from step 2 if the Product Name in the App matches the Webhook Product name and a custom attribute called event matches the event which invoked the proxy
  4. Make an API call to invoke the subscriber using the callback URL in the App

However, it is an antipattern if I use Apigee Management calls within the proxy so I thought I should use the AccessEntity Policy to get the above information. However I could not find a way to get the list of all Apps using the AccessEntity policy. I can only get the information of a specific Product or oa Specific App but that does no help since I will not be aware of all the developers who will be subscribing to the WebHook product at design time.

I have also thought of other designs where the mapping of the event to the callback URLs is held in some sort of DB or KVM, but then it brings the overhead of maintaining that list. Since this association can be found in the App and Product mapping, I thought its best to leverage the same.

Thanks in advance in how I can achieve the design using a proxy.

0 6 835
6 REPLIES 6