Sunday, August 16, 2015

Proxy Flow Re-use using maven plugin

Proxy Flow re-use is quite commonly encountered during API proxy development with Apigee.

For example, consider request flows with two kinds of Authentication (Basic & OAuth) mechanisms. The two request flows differ in Auth policies used - one uses Basic Auth and other uses OAuth; assuming the rest of request flow is exactly same including fault handling and logging.

In such cases, it's desirable to have a common proxy flow that can reused in both the request flows.

At the moment, Apigee Edge does not support flow re-use out of the box. This can done using maven plugin which I implemented - Proxy Dependency Maven Plugin .The plugin works like macro pre-processor that substitutes common flows during build time.

The link provided above, documents in detail the working of the plugin and the pattern for modelling re-use in proxies.