后浪笔记一零二四

nats 2.2 推出的 subject mapping and traffic shaping

可以实现金丝雀部署,A/B测试,主题迁移等功能。

  1. 重命名主题
mappings = {
  orderinfo: neworderinfo
}
  1. 使用通配符来对多级主题的名称进行重组
mappings = {
  order.*.*: neworder.$2.$1
}

例如: order.third.status -> neworder.status.third

  1. 根据权重来转发消息到新的主题
mappings = {
  conrses.resources: [
    { destination: courses.resources.beijing, weight: 70% },
    { destination: courses.resources.shanghai, weight: 30% }
  ]
}
mappings = {
  myservice.requests: [
    { destination: myservice.requests.v1, weight: 98% },
    { destination: myservice.requests.v2, weight: 2% }
  ]
}
  1. 人为丢掉部分消息
mappings = {
  courses.requests.log.>: {
    { destination: courses.requests.log.>, weight: 50% }
  }
}

本文发表于 0001-01-01,最后修改于 0001-01-01。

本站永久域名「 jiavvc.top 」,也可搜索「 后浪笔记一零二四 」找到我。


上一篇 « 下一篇 »

赞赏支持

请我吃鸡腿 =^_^=

i ysf

云闪付

i wechat

微信

推荐阅读

Big Image