简体   繁体   English

WSO2 API管理器1.7.0-如何从自定义远程注册表动态获取端点

[英]WSO2 api manager 1.7.0 - how to dynamically get the endpoint from a custom remote registry

We have a custom service registry and I'd like to route the API call to an endpoint dynamically retrieved from that registry (in fact the registry call retrieves a list of endpoints for that service). 我们有一个自定义服务注册中心,我想将API调用路由到从该注册中心动态检索到的端点(实际上,该注册调用会检索该服务的端点列表)。 Is there a way to do this with the API Manager 1.7.0 ? 使用API​​ Manager 1.7.0可以做到这一点吗? I see that the LoadBalanced configuration accepts only static endpoints. 我看到LoadBalanced配置仅接受静态端点。

I also looked for using the inline scripting but I did not find a proper way to call the remote registry before setting the endpoint to route to. 我还寻找使用内联脚本的方法,但是在设置要路由到的端点之前,我没有找到调用远程注册表的正确方法。

You can try this with the custom sequences. 您可以尝试使用自定义序列。

What you have to do is, define HTTP endpoint with properties and assign values for properties in the custom sequence. 您需要做的是,使用属性定义HTTP端点,并按自定义顺序为属性分配值。

You have to define your custom sequence and store them in registry. 您必须定义您的自定义序列并将其存储在注册表中。 When publishing the api, select the proper custom sequence. 发布api时,请选择适当的自定义序列。

Within custom sequence, try to use class mediator/any other logic to extract your endpoint details and assign them to properties. 在自定义序列中,尝试使用类介体/任何其他逻辑来提取端点详细信息并将其分配给属性。 Those properties will be used in your http endpoint definition. 这些属性将在您的http端点定义中使用。

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

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