How to implement a loopback API Proxy in Apigee Microgateway

sezhou
New Member

In the Edge Gateway, to implement a loopback API Proxy, I can just define a "NoRoute" route rule in the PreFlow of Proxy Endpoints as follows

<RouteRule name="NoRoute"/>

However, for a Microgateway API Proxy, this "NoRoute" route rule doesn't seem to be working. The Proxy will always try to reach the <HTTPTargetConnection> defined in the PreFlow of the Target Endpoints.

To clarify, a loopback proxy is that it receives API requests, processes them in the proxy, and send responses back without talking to a backend target endpoint.

Anyone knows how this can be done for Microgateway Proxy?

Solved Solved
0 3 1,239
1 ACCEPTED SOLUTION

I bet you could build what you want based on the existing healthcheck plugin.

https://github.com/apigee/microgateway-plugins/blob/master/healthcheck/index.js

The healthcheck plugin responds with a health check payload if the request handled by the edge micro gateway is for the path /healthcheck. It doesn't invoke any target. You could use that as a starting point, and insert your own conditional checks to build a loopback endpoint of some other kind.

View solution in original post

3 REPLIES 3

I bet you could build what you want based on the existing healthcheck plugin.

https://github.com/apigee/microgateway-plugins/blob/master/healthcheck/index.js

The healthcheck plugin responds with a health check payload if the request handled by the edge micro gateway is for the path /healthcheck. It doesn't invoke any target. You could use that as a starting point, and insert your own conditional checks to build a loopback endpoint of some other kind.

Thanks it works. It looks like the RouteRule "NoRoute" has no effect in Microgateway. The code in the healthcheck plugin generates the response and ends the response and i think that does the trick.

Hello, can this stuff be useful for https://www.hookupgeek.com/tori-black/ how can i implement it?