WSO2 中的每个资源可以使用不同的端点吗?

Can different endpoints be used for each resource in WSO2?

我正在尝试为后端创建 API 代理以重新验证 API。

我使用下面给出的解决方案来映射请求。

https://apim.docs.wso2.com/en/latest/deploy-and-publish/deploy-on-gateway/api-gateway/message-mediation/mapping-the-parameters-of-your-backend-urls-with-the-api-publisher-urls/

我可以像这个例子那样映射请求:

来自

本地主机:XXXX/api/abc/5

xyz.com/api/?function=getabc&number=5

但是,我需要为每个资源创建不同的端点才能使这种方法起作用。但是,整个 API 似乎只使用了一个端点。我也无法为每个资源创建不同的 API,因为上下文会有所不同。

如何为每个资源创建不同的请求映射。我的方法错了吗?

您可以尝试动态端点功能。使用此功能,每个 API 可以有多个端点。创建 API 时,您需要将端点类型设置为“动态端点”并上传设置“至”header 的中介 in-sequence。在序列中,您可以根据请求路径指定您的逻辑以路由到正确的端点(设置正确的“To”header)。

https://apim.docs.wso2.com/en/latest/deploy-and-publish/deploy-on-gateway/api-gateway/message-mediation/adding-dynamic-endpoints/#adding-dynamic-endpoints

这里有一篇博客 post 对 2.x 版本的 APIM 进行了相同的解释。
https://lashan.medium.com/dynamically-setting-the-endpoint-uri-in-wso2-api-manager-83a3a6243ce