Search code examples
express-gateway

Express Gateway policy


I am testing out EG policies for my microservices app. One requirement is that whenever express gateway receives a request, I want to invoke a particular service, parse its result, and based on the result decide to proceed for downstream calls or return an error. It appears to be a very standard requirement. Is there any existing policy (could not find any here) for such scenarios or do I need to write a custom one? Thanks


Solution

  • this is Vincenzo — I am the maintainer of Express Gateway :)

    Unfortunately you spotted a lack of Express Gateway, which is "post proxy" policies. Fundamentally right now the proxy policy is the last one to be executed and there's nothing else you can do before sending the request to the downstream client.

    This is a limitation that we definitely need to fix, although you're the first one to bring up this use case.

    This does not mean that you cannot do it now. I think it'd be kind of easy as well, but unfortunately you'd need to fork the Gateway and add some code.

    If you could articulate a little bit more your use case, we might evaluate if there's a way to make it happen in the next release :)