时间:2025-06-12 09:12
人气:
作者:admin
相关参考:
api订阅策略在admin后台,你可以通过Rate Limiting Policies>Subscription Policies来添加和修改自定义的策略,并且它可以在使用次数(count),使用带宽( Bandwidth),异常事件数量等方面对请求进行限制。
限制单位
请求数

请求带宽

事件数

突发流量限制

免费与商业的策略,默认使用免费策略,商业策略可以自定义限制方式,它们在达到限制后都会对接口停止订阅,直到下一个策略周期的到来


被限流后,将返回这个错误
# http 429
{
"code": "900804",
"message": "Message throttled out",
"description": "You have exceeded your quota .You can access API after 2025-Jun-10 09:40:00+0000 UTC",
"nextAccessTime": "2025-Jun-10 09:40:00+0000 UTC"
}
开发者平台,在应用中看到api的锁定状态

发布者对api管理员,可以锁定某个api,可能对发布者管理员来说,某个应用使用不太正常,需要禁用它对api的访问

应用订阅的api被锁定后,应用再调用api时,返回这个错误
# http 401
{
"code": "900907",
"message": "The requested API is temporarily blocked",
"description": "Access failure for API: /user-register/1.0.0, version: 1.0.0 status: (900907) - The requested API is temporarily blocked"
}
锁定api的接口
/api/am/publisher/v4/subscriptions/block-subscription?subscriptionId=e55f1158-e291-4de4-a6e4-c500b902d025&blockState=BLOCKED
api订阅状态修改后生效的缓存时间

关闭缓存,配置实时生效
如果您不接受缓存的时长,或者需要实时让配置生效,那可以把缓存关闭
wso2:
apim:
configurations:
cache:
gateway_token:
# -- Gateway token cache enabled
enabled: false
# -- Gateway token cache expiration time
expiryTime: "15m"
resource:
# -- Gateway resource cache enabled
enabled: false
# -- Gateway resource cache expiration time
expiryTime: "900s"
km_token:
# -- Gateway KM token cache enabled
enabled: false
# -- Gateway KM token cache expiration time
expiryTime: "15m"
这块内容需要结合analytics功能来实现,并且需要配置monetization对应的银行账户,以便生产费用后,如何将钱打到账户中
/api/am/devportal/apis/{apiId}
/api/am/devportal/apis/{apiId}/subscription-policies
作者:仓储大叔,张占岭,
荣誉:微软MVP
QQ:853066980
支付宝扫一扫,为大叔打赏!
【从0到1构建一个ClaudeAgent】协作-Agent团队