1 unstable release

new 0.1.0 Jan 23, 2025

#608 in Parser implementations

Download history 236/week @ 2025-01-21

236 downloads per month
Used in 2 crates

MIT/Apache

13KB
121 lines

watermelon

Pure Rust NATS client implementation and tokio integration

watermelon is an independent implementation of the NATS protocol. The goal of the project is to produce an opinionated, composable, idiomatic implementation with a keen eye on security, correctness and ease of use.

Watermelon is divided into multiple crates, all hosted in the same monorepo.

Crate name Crates.io release Documentation Description
watermelon crates.io Documentation High level actor based implementation NATS Core and NATS Jetstream client implementation
watermelon-mini crates.io Documentation Minimal NATS Core client implementation
watermelon-net crates.io Documentation Low-level NATS Core network implementation
watermelon-proto crates.io Documentation #[no_std] NATS Core Sans-IO protocol implementation
watermelon-proto crates.io Documentation Minimal NKeys implementation for NATS client authentication

Advantages over async-nats

  1. Security: this client is protected against command injection attacks via checked APIs like Subject.
  2. Extendibility: exposes the inner components via watermelon-mini and watermelon-net.
  3. Error handling: subscribe errors are correctly caught - internally enables server verbose mode.
  4. Fresh start: this client only supports nats-server >=2.10.0. We may drop support for older server versions as new ones come out. tls:// also uses TLS-first handshake mode by default.
  5. Licensing: dual licensed under MIT and APACHE-2.0.

Disadvantages over async-nats

  1. Completeness: most APIs (Jetstream specifically) haven't been implemented yet.
  2. Future work: we may never add support for functionallity that we, M4SS Srl, don't use.
  3. Difference in APIs: official NATS clients tend to have similar APIs. watermelon does not follow the official guidelines.
  4. Ecosystem: as the client does not support older server versions or ignore old configuration options, it may not work in an environment that hasn't adopted the new standards yet.
  5. Backwards compatibility: this client is in no way compatible with the async-nats API and may make frequent breaking changes.

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Dependencies

~66MB
~2M SLoC