【问题标题】:Wso2 apim custom metricsWso2 apim 自定义指标
【发布时间】:2021-03-20 13:18:39
【问题描述】:

我们计划部署 apim 并按自定义指标(请求正文的属性之一中的字符数)向开发人员收费。是否可以在不修改 apim 源的情况下做到这一点?

【问题讨论】:

    标签: wso2 wso2-am


    【解决方案1】:

    您可以使用以下方法来做到这一点。

    1. 添加全局或 API 级别的自定义中介策略 - https://apim.docs.wso2.com/en/latest/learn/api-gateway/message-mediation/changing-the-default-mediation-flow-of-api-requests/#creating-per-api-mediation-policies

    您可以编写一个类中介来读取请求正文并进行任何计算。然后以异步方式将数据发布到另一个服务。

    1. 您可以编写一个处理程序来做同样的事情 - https://apim.docs.wso2.com/en/latest/develop/extending-api-manager/extending-gateway/writing-custom-handlers/#introducing-handlers

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-10-17
      • 1970-01-01
      • 2023-03-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-12-15
      相关资源
      最近更新 更多