refactor: 拆分拼多多限流配置并将 PMC 开关下沉到环境配置

This commit is contained in:
2026-09-05 01:38:09 +08:00
parent 4c053702e2
commit b2e0ee5da4
7 changed files with 118 additions and 92 deletions
@@ -60,3 +60,8 @@ logging:
top.xyquan.ecomdmbbackend: INFO
org.springframework.security: INFO
org.springframework.web: INFO
# 拼多多 PMC:本地可开;多实例部署时仅一台 true
pdd:
msg:
enabled: false
@@ -49,3 +49,8 @@ logging:
top.xyquan.ecomdmbbackend: INFO
org.springframework.security: INFO
org.springframework.web: INFO
# 拼多多 PMC:多实例仅一台开启
pdd:
msg:
enabled: false
@@ -50,3 +50,8 @@ logging:
top.xyquan.ecomdmbbackend: INFO
org.springframework.security: WARN
org.springframework.web: WARN
# 拼多多 PMC:多实例仅一台开启
pdd:
msg:
enabled: false
@@ -48,3 +48,8 @@ logging:
top.xyquan.ecomdmbbackend: INFO
org.springframework.security: WARN
org.springframework.web: WARN
# 拼多多 PMC:多实例仅一台开启
pdd:
msg:
enabled: true
@@ -8,6 +8,8 @@ spring:
import:
- optional:classpath:config/channel-pdd.yml
- optional:file:./config/channel-pdd.yml
- optional:classpath:config/channel-pdd-pop-rate-limit.yml
- optional:file:./config/channel-pdd-pop-rate-limit.yml
jackson:
time-zone: Asia/Shanghai
mvc:
@@ -0,0 +1,93 @@
# 拼多多 POP 出站限流(按 API type)
# 由 application.yml 通过 spring.config.import 引入;未声明的接口走 default-rule / 代码默认
# key 与 PddPopApiTypes 一致
pdd:
pop:
rate-limit:
enabled: true
acquire-wait-ms: 5000
# 平台频控被动退避:2s → 5s → 15s
backoff-ms: [2000, 5000, 15000]
# 约官方上限 60% 单店余量 + 本 ISV 短窗
default-rule:
shop-limit: 6000
shop-window-seconds: 60
app-burst-limit: 800
app-burst-window-seconds: 10
apis:
pdd.order.list.get:
shop-limit: 6000
shop-window-seconds: 60
app-burst-limit: 800
app-burst-window-seconds: 10
pdd.order.number.list.increment.get:
shop-limit: 6000
shop-window-seconds: 60
app-burst-limit: 800
app-burst-window-seconds: 10
pdd.order.information.get:
shop-limit: 6000
shop-window-seconds: 60
app-burst-limit: 800
app-burst-window-seconds: 10
pdd.goods.information.get:
shop-limit: 5000
shop-window-seconds: 60
app-burst-limit: 800
app-burst-window-seconds: 10
pdd.goods.list.get:
shop-limit: 5000
shop-window-seconds: 60
app-burst-limit: 800
app-burst-window-seconds: 10
pdd.goods.add:
shop-limit: 2000
shop-window-seconds: 60
app-burst-limit: 400
app-burst-window-seconds: 10
pdd.goods.image.upload:
shop-limit: 3000
shop-window-seconds: 60
app-burst-limit: 600
app-burst-window-seconds: 10
pdd.goods.authorization.cats:
shop-limit: 6000
shop-window-seconds: 60
app-burst-limit: 800
app-burst-window-seconds: 10
pdd.goods.logistics.template.get:
shop-limit: 6000
shop-window-seconds: 60
app-burst-limit: 800
app-burst-window-seconds: 10
pdd.goods.cat.template.get:
shop-limit: 6000
shop-window-seconds: 60
app-burst-limit: 800
app-burst-window-seconds: 10
pdd.goods.spec.get:
shop-limit: 6000
shop-window-seconds: 60
app-burst-limit: 800
app-burst-window-seconds: 10
pdd.goods.spec.id.get:
shop-limit: 6000
shop-window-seconds: 60
app-burst-limit: 800
app-burst-window-seconds: 10
pdd.one.express.cost.template:
shop-limit: 6000
shop-window-seconds: 60
app-burst-limit: 800
app-burst-window-seconds: 10
pdd.mall.info.get:
shop-limit: 6000
shop-window-seconds: 60
app-burst-limit: 800
app-burst-window-seconds: 10
pdd.pmc.user.permit:
shop-limit: 600
shop-window-seconds: 60
app-burst-limit: 200
app-burst-window-seconds: 10
@@ -1,5 +1,6 @@
# 拼多多渠道配置(OAuth / POP 出站 / 订单同步)
# 拼多多渠道配置(OAuth / POP 分页 / PMC topics / 订单同步)
# 由 application.yml 通过 spring.config.import 引入
# POP 限流见 channel-pdd-pop-rate-limit.yml;msg.enabled 见各 application-{profile}.yml
pdd:
oauth:
@@ -10,101 +11,11 @@ pdd:
authorize-url: https://fuwu.pinduoduo.com/service-market/auth
state-ttl-seconds: 600
# POP 出站:分页、限流;未在 apis 中声明的接口走 default-rule / 代码默认
pop:
default-page-size: 100
rate-limit:
enabled: true
acquire-wait-ms: 5000
# 平台频控被动退避:2s → 5s → 15s
backoff-ms: [2000, 5000, 15000]
# 约官方上限 60% 单店余量 + 本 ISV 短窗
default-rule:
shop-limit: 6000
shop-window-seconds: 60
app-burst-limit: 800
app-burst-window-seconds: 10
# 按 API type 覆盖(key 与 PddPopApiTypes 一致)
apis:
pdd.order.list.get:
shop-limit: 6000
shop-window-seconds: 60
app-burst-limit: 800
app-burst-window-seconds: 10
pdd.order.number.list.increment.get:
shop-limit: 6000
shop-window-seconds: 60
app-burst-limit: 800
app-burst-window-seconds: 10
pdd.order.information.get:
shop-limit: 6000
shop-window-seconds: 60
app-burst-limit: 800
app-burst-window-seconds: 10
pdd.goods.information.get:
shop-limit: 5000
shop-window-seconds: 60
app-burst-limit: 800
app-burst-window-seconds: 10
pdd.goods.list.get:
shop-limit: 5000
shop-window-seconds: 60
app-burst-limit: 800
app-burst-window-seconds: 10
pdd.goods.add:
shop-limit: 2000
shop-window-seconds: 60
app-burst-limit: 400
app-burst-window-seconds: 10
pdd.goods.image.upload:
shop-limit: 3000
shop-window-seconds: 60
app-burst-limit: 600
app-burst-window-seconds: 10
pdd.goods.authorization.cats:
shop-limit: 6000
shop-window-seconds: 60
app-burst-limit: 800
app-burst-window-seconds: 10
pdd.goods.logistics.template.get:
shop-limit: 6000
shop-window-seconds: 60
app-burst-limit: 800
app-burst-window-seconds: 10
pdd.goods.cat.template.get:
shop-limit: 6000
shop-window-seconds: 60
app-burst-limit: 800
app-burst-window-seconds: 10
pdd.goods.spec.get:
shop-limit: 6000
shop-window-seconds: 60
app-burst-limit: 800
app-burst-window-seconds: 10
pdd.goods.spec.id.get:
shop-limit: 6000
shop-window-seconds: 60
app-burst-limit: 800
app-burst-window-seconds: 10
pdd.one.express.cost.template:
shop-limit: 6000
shop-window-seconds: 60
app-burst-limit: 800
app-burst-window-seconds: 10
pdd.mall.info.get:
shop-limit: 6000
shop-window-seconds: 60
app-burst-limit: 800
app-burst-window-seconds: 10
pdd.pmc.user.permit:
shop-limit: 600
shop-window-seconds: 60
app-burst-limit: 200
app-burst-window-seconds: 10
# PMC 消息:WS 默认关闭(多实例仅一台开启);授权后自动 permit 商品 topics
# PMC 消息:enabled 在环境配置中设置(多实例仅一台开启)
msg:
enabled: true
auto-permit: true
goods-topics:
- pdd_goods_GoodsAdd