目录
Neil

Add support to customize leafnode ping_interval (#8718)

Addresses the Leafnodes part of #4991.

What

Adds ping_interval and ping_max as options in the leafnodes{} config block, independent from the global settings:

leafnodes {
  port: 7422
  ping_interval: '5s'
  ping_max: 6
}

This mirrors the existing route override from #5029 and the existing websocket.ping_interval override. Split out from the gateway PR to keep each change small and reviewable.

How

  • LeafNodeOpts.PingInterval / LeafNodeOpts.MaxPingsOut (opts.go), parsed in parseLeafNodes.
  • Wired through the same three call sites the route override uses in client.go: processPingTimer, setPingTimer, setFirstPingTimer.
  • No change needed in leafnode.go — unlike gateway/route, leafnode has no direct watchForStaleConnection call site to update.

Testing

Added TestLeafNodeCustomPing, modeled on TestRouteCustomPing. Verified it fails without the client.go wiring (ping never fires within the configured interval) and passes with it. Ran the full leafnode/parse-leaf/ config-check suite locally with no regressions.

12小时前13582次提交

NATS Logo

NATS is a simple, secure and performant communications system for digital systems, services and devices. NATS is part of the Cloud Native Computing Foundation (CNCF). NATS has over 40 client language implementations, and its server can run on-premise, in the cloud, at the edge, and even on a Raspberry Pi. NATS can secure and simplify design and operation of modern distributed systems.

License Build Release Slack Coverage Docker Downloads GitHub Downloads CII Best Practices Artifact Hub

Documentation

Contact

  • Twitter: Follow us on Twitter!
  • Google Groups: Where you can ask questions
  • Slack: Click here to join. You can ask questions to our maintainers and to the rich and active community.

Contributing

If you are interested in contributing to NATS, read about our…

Roadmap

The NATS product roadmap can be found here.

Adopters

Who uses NATS? See our list of users on https://nats.io.

Security

Security Audit

A third party security audit was performed by Trail of Bits following engagement by the Open Source Technology Improvement Fund (OSTIF). You can see the full report from April 2025 here.

Reporting Security Vulnerabilities

If you’ve found a vulnerability or a potential vulnerability in the NATS server, please let us know at nats-security.

License

Unless otherwise noted, the NATS source files are distributed under the Apache Version 2.0 license found in the LICENSE file.

    Gitlink(确实开源)
  • 加入我们
  • 官网邮箱:gitlink@ccf.org.cn
  • QQ群
  • QQ群
  • 公众号
  • 公众号

版权所有:中国计算机学会技术支持:开源发展技术委员会
京ICP备13000930号-9 京公网安备 11010802047560号