简体   繁体   English

Express Gateway政策

[英]Express Gateway policy

I am testing out EG policies for my microservices app. 我正在为我的微服务应用程序测试EG策略。 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 谢谢

this is Vincenzo — I am the maintainer of Express Gateway :) 这是Vincenzo - 我是Express Gateway的维护者:)

Unfortunately you spotted a lack of Express Gateway, which is "post proxy" policies. 不幸的是,你发现缺少Express Gateway,这是“后代理”政策。 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 :) 如果您能够更清楚地说明您的用例,我们可能会评估是否有办法在下一个版本中实现它:)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM