V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
gitrebase
V2EX  ›  程序员

有在生产环境用 NATS.io 的吗

  •  
  •   gitrebase · 131 天前 · 1221 次点击
    这是一个创建于 131 天前的主题,其中的信息可能已经有所发展或是发生改变。

    最近 v 站经常有个老哥给 NATS 打广告……就稍微看了下这个消息中间件,能实现:

    • pub/sub
    • req/resp (应该是向某个 subject req 的时候顺便给他发一个临时的 subject 并监听,让 subscriber 处理完后将消息发到这个临时 subject )
    • stream (持久化的 pub/sub ,跟 mq 差不多)
    • KV storage (不知道用作 cache 性能怎么样,但用作 dynamic configuration 应该没问题)
    • object storage (还在 beta )
    • micro-service (基于 subject/topic 就能支持 service discovery 和 load balance ,虽然估计也没人真的在生产环境用这个 RPC 吧哈哈)

    看了这个性能对比,感觉 NATS 被 Pulsar 爆杀,但后来发现这个对比是 Pulsar 老东家发出来的,emm 懂得都懂,就仅供参考了

    总的来说还是感觉有点意思,NATS 也已经发布了很久了,不知道有没有老哥在生产环境使用

    5 条回复    2023-12-31 00:13:03 +08:00
    gitrebase
        1
    gitrebase  
    OP
       131 天前
    但 NATS 对于 micro-service 的实现里好像没有 middleware ,可能不是很好用;主要应该也就用的“消息中间件”的功能吧
    akaHenry
        2
    akaHenry  
       131 天前   ❤️ 1
    @gitrebase nats 挺好用. 国外用的很多. 国内还是 Kafka 为主.

    go-micro 的插件集, 有 nats 集成. 其他框架, 可以照着抄一份就好.

    也没啥复杂的. nats 不只是 消息队列, 有很多扩展用法.

    https://github.com/go-micro/go-micro

    https://github.com/go-micro/plugins
    RedBeanIce
        3
    RedBeanIce  
       126 天前
    想请问一下,,他保证消息可达么。

    我通过 product 向 consumer 发送一份消息,如果 consumer 没有收到,,
    能够在 product 监听到结果么,true/false ?
    gitrebase
        4
    gitrebase  
    OP
       126 天前
    @RedBeanIce #3 今天刚好在 Slack 看到了一个提问,是不是和你问的是不是一件事:

    Q: Hi, i am using nats.go client library, is there a way that we can know if a msg is redeliver msg.(JS enabled, client version v1.28.0)
    A: You can get the `Metadata()` of the message and then look for `NumDelivered` to be greater than 1
    RedBeanIce
        5
    RedBeanIce  
       126 天前
    maybe not. thanks
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   764 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 20:44 · PVG 04:44 · LAX 13:44 · JFK 16:44
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.