1

我在 WSO2 微网关的拦截器中使用 Response.getResolvedRequestedURI 来查找生产 URL。但是,我看到这个 api 总是返回 null。

获取 wso2 已将呼叫转发到的生产 url 的方法是什么?

/**
 * Get the ultimate request URI that was made to receive the response when redirect is on
 * @return the requested URI
 */
public String getResolvedRequestedURI() 
4

1 回答 1

1

Microgateway 将请求转发到的端点可以在响应路径中检索,如下所示。

public boolean interceptResponse(Caller caller, Response response) {
    Map<String, Object> attributes = Utils.getInvocationContextAttributes();
    Object destination = attributes.get("destination");
   .
   .
   .
}
于 2020-07-23T17:33:38.567 回答