Rust client for NATS, the cloud native messaging system.

Overview

A Rust client for the NATS messaging system.

Status

License Apache 2 Crates.io Documentation Build Status

Motivation

Rust may be the most interesting new language the NATS ecosystem has seen. We believe this client will have a large impact on NATS, distributed systems, and embedded and IoT environments. With Rust we wanted to be as idiomatic as we could be and lean into the strengths of the language. We moved many things that would have been runtime checks and errors to the compiler, most notably options on connections, and having subscriptions generate multiple styles of iterators, since iterators are a first class citizen in Rust. We also wanted to be aligned with the NATS philosophy of simple, secure, and fast!

Feedback

We encourage all folks in the NATS and Rust ecosystems to help us improve this library. Please open issues, submit PRs, etc. We're available in the rust channel on the NATS slack as well!

Example Usage

> cargo run --example nats-box -- -h

Basic connections, and those with options. The compiler will force these to be correct.

let nc = nats::connect("demo.nats.io")?;

let nc2 = nats::Options::with_user_pass("derek", "s3cr3t!")
    .with_name("My Rust NATS App")
    .connect("127.0.0.1")?;

let nc3 = nats::Options::with_credentials("path/to/my.creds")
    .connect("connect.ngs.global")?;

let nc4 = nats::Options::new()
    .add_root_certificate("my-certs.pem")
    .connect("tls://demo.nats.io:4443")?;

Publish

nc.publish("my.subject", "Hello World!")?;

nc.publish("my.subject", "my message")?;

// Publish a request manually.
let reply = nc.new_inbox();
let rsub = nc.subscribe(&reply)?;
nc.publish_request("my.subject", &reply, "Help me!")?;

Subscribe

let sub = nc.subscribe("foo")?;
for msg in sub.messages() {}

// Using next.
if let Some(msg) = sub.next() {}

// Other iterators.
for msg in sub.try_iter() {}
for msg in sub.timeout_iter(Duration::from_secs(10)) {}

// Using a threaded handler.
let sub = nc.subscribe("bar")?.with_handler(move |msg| {
    println!("Received {}", &msg);
    Ok(())
});

// Queue subscription.
let qsub = nc.queue_subscribe("foo", "my_group")?;

Request/Response

let resp = nc.request("foo", "Help me?")?;

// With a timeout.
let resp = nc.request_timeout("foo", "Help me?", Duration::from_secs(2))?;

// With multiple responses.
for msg in nc.request_multi("foo", "Help")?.iter() {}

// Publish a request manually.
let reply = nc.new_inbox();
let rsub = nc.subscribe(&reply)?;
nc.publish_request("foo", &reply, "Help me!")?;
let response = rsub.iter().take(1);

Minimum Supported Rust Version (MSRV)

The minimum supported Rust version is 1.41.0.

Sync vs Async

The Rust ecosystem has a diverse set of options for async programming. This client library can be used with any async runtime out of the box, such as async-std and tokio.

The async interface provided by this library is implemented as just a thin wrapper around its sync interface. Those two interface styles look very similar, and you're free to choose whichever works best for your application.

Features

The following is a list of features currently supported and planned for the near future.

  • Basic Publish/Subscribe
  • Request/Reply - Singelton and Streams
  • Authentication
    • Token
    • User/Password
    • Nkeys
    • User JWTs (NATS 2.0)
  • Reconnect logic
  • TLS support
  • Direct async support
  • Crates.io listing
  • Header Support

Miscellaneous TODOs

  • Ping timer
  • msg.respond
  • Drain mode
  • COW for received messages
  • Sub w/ handler can't do iter()
  • Backup servers for option
  • Travis integration
Comments
  • all async operations block forever at 500 concurrent subscriptions

    all async operations block forever at 500 concurrent subscriptions

    Under the hood, asynchronous subscriptions just wrap synchronous calls with blocking::unblock. Under the hood, unblock moves work to a pool of up to 500 threads.

    This creates an obvious bottleneck: If you create 500 subscriptions, all other asynchronous operations that you attempt will just block forever (or until those subscriptions receive data or are closed).

    Perhaps the blocking crate isn't the best fit here. And perhaps there should be a bigger warning about everything breaking if you hit this limit.

    opened by ccbrown 19
  • Can't spawn asynk::Subscription

    Can't spawn asynk::Subscription

    I'm using smol and nats, and just migrated from rants to this official client since it now has direct async support.

    With rants, I was creating a subscription stream and mapping messages to their deserialized data, then spawning a task to run through that stream in the background. After migrating, I'm getting this:

    error[E0277]: `std::sync::MutexGuard<'_, std::collections::HashSet<u64>>` cannot be sent between threads safely
       --> detect/src/main.rs:72:5
        |
    72  |     Task::spawn(async move {
        |     ^^^^^^^^^^^ `std::sync::MutexGuard<'_, std::collections::HashSet<u64>>` cannot be sent between threads safely
        |
       ::: /Users/andrewbanchich/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/src/libcore/future/mod.rs:55:43
        |
    55  | pub const fn from_generator<T>(gen: T) -> impl Future<Output = T::Return>
        |                                           ------------------------------- within this `impl core::future::future::Future`
        |
       ::: /Users/andrewbanchich/.cargo/registry/src/github.com-1ecc6299db9ec823/async-executor-0.1.2/src/lib.rs:421:31
        |
    421 |     pub fn spawn(future: impl Future<Output = T> + Send + 'static) -> Task<T>
        |                               ------------------ required by this bound in `async_executor::Task::<T>::spawn`
    
    opened by andrewbanchich 17
  • Support for other executors ?

    Support for other executors ?

    @stjepang Forgive me in advance :) but I was wondering if there is any easy way to remove Smol dependency such that I can only use one executor in my app? My application relies heavily on Tokio and Tokio ecosystem so naturally, I would prefer to keep it that way.

    The rationale for my request is that when I was trying to convert my app to use Async NATS, I have run into some locking problems when I was trying to pass messages from tasks running in Smal to tasks running in Tokio via channels.

    I must admit, I quickly revert back to the blocking code, but it would be nice if everything was executed asynchronously in one executor.

    opened by dawid-nowak 16
  • Async client (unchanged API)

    Async client (unchanged API)

    Okay here's a quick sketch of what a new, single-threaded client based on smol might look like. Right now, this simple client can connect to demo.nats.io and publish messages.

    @spacejam What do you think and how would you like to move forward from here?

    opened by ghost 16
  • Proposed update to enable reconnect on first attempt

    Proposed update to enable reconnect on first attempt

    We have had issues connecting on the first attempt, similar to issue brought up in the past: https://github.com/nats-io/nats.rs/issues/99

    We modified the nats.rs to enable us to enter the retry loop on the first connection attempt. Our application behavior is such that we do not require the NatsServer be up and running when we start. This change allows for that behavior.

    opened by pozsgaic 15
  • Subscription with_handler is easy to drop

    Subscription with_handler is easy to drop

    I have seen this and others reported as well. If you do not capture a subscriber from a call such as

    nc.subscribe("help.request")?.with_handler(move |m| {
        m.respond("ans=42")?; Ok(())
    });
    

    The subscription will be dropped immediately and no messages will be received.

    We could return an io::Result to have the compiler complain that the return result is not being handled, etc.

    Or maybe look to have the subscription lifetime tied to the callback thread?

    opened by derekcollison 15
  • unsub code looks wrong

    unsub code looks wrong

    First of all, this (and similar code for close function): https://github.com/nats-io/nats.rs/blob/b5576cfee5edc3687975356d5c9f2e1ad248bbfc/src/lib.rs#L655-L658 Looks suspicious after looking at what .unsub() does: https://github.com/nats-io/nats.rs/blob/b5576cfee5edc3687975356d5c9f2e1ad248bbfc/src/lib.rs#L585-L592

    The property .unsub is immediately flipped back.

    Second, the only place where .unsub property was checked seems to be incorrect too: https://github.com/nats-io/nats.rs/blob/b5576cfee5edc3687975356d5c9f2e1ad248bbfc/src/lib.rs#L625-L634

    I have a feeling that it should have been if !self.unsub, or better yet, don't use .unsub and name it .subscribed with the opposite meaning, then if self.subscribed would be easy and natural to read.

    I would be able to make a PR, but I'm not 100% I understood it correctly.

    P.S. I'd not mutate that property from the outside at all if possible, maybe consider moving different structs into different files, at least to a degree, to add more boundaries and make API cleaner.

    opened by nazar-pc 12
  • all async operations still block forever at 500 concurrent subscriptions

    all async operations still block forever at 500 concurrent subscriptions

    Under the hood, asynchronous subscriptions just wrap synchronous calls with blocking::unblock. Under the hood, unblock moves work to a pool of up to 500 threads.

    This creates an obvious bottleneck: If you create 500 subscriptions, all other asynchronous operations that you attempt will just block forever (or until those subscriptions receive data or are closed).

    Perhaps the blocking crate isn't the best fit here. And perhaps there should be a bigger warning about everything breaking if you hit this limit.

    This issue was first raised in https://github.com/nats-io/nats.rs/issues/210. That issue was closed with this comment:

    0.15.2 has been published which includes the fix for this

    But 0.15.2 does not include a fix or any changes related to the 500 worker limit.

    opened by ccbrown 11
  • Latency Compared to Go client

    Latency Compared to Go client

    I've been trying to benchmark NATS for my use case. Using the latency-tests tool I get something like this:

    ./latency -tr 1000 -tt 5s -sz 512
    ==============================
    Pub Server RTT : 98µs
    Sub Server RTT : 80µs
    Message Payload: 512B
    Target Duration: 5s
    Target Msgs/Sec: 1000
    Target Band/Sec: 1000K
    ==============================
    HDR Percentiles:
    10:       88µs
    50:       108µs
    75:       122µs
    90:       137µs
    99:       202µs
    99.9:     253µs
    99.99:    265µs
    99.999:   982µs
    99.9999:  982µs
    99.99999: 982µs
    100:      982µs
    ==============================
    

    However, when using the Rust client and doing a very simple benchmark, my latency is ~2-5x of that. The following code is the simplest variation I have, but I tried various things: Reading and writing in a different thread, using tokio, etc, to replicate more closely what the Go benchmark does. I also tried putting explicit flush calls. The results are always the same. Am I doing something fundamentally wrong in the benchmark?

    For reference, the rtt function gives the latency I expect, around 80 micros.

        let nc1 = nats::connect("localhost:4222").unwrap();
        let nc2 = nats::connect("localhost:4222").unwrap();
        let sub = nc2.subscribe("foo").unwrap();
        loop {
            let now = std::time::Instant::now();
            nc1.publish("foo", "").unwrap();
            sub.next().unwrap();
            println!("RTT: {:?}", now.elapsed());
            std::thread::sleep(std::time::Duration::from_millis(100));     
        }
    
    RTT: 339.942µs
    RTT: 337.414µs
    RTT: 367.48µs
    RTT: 357.508µs
    RTT: 333.453µs
    RTT: 392.305µs
    RTT: 302.826µs
    RTT: 495.053µs
    RTT: 213.117µs
    RTT: 187.48µs
    RTT: 351.434µs
    RTT: 419.223µs
    RTT: 437.84µs
    RTT: 376.603µs
    RTT: 295.522µs
    RTT: 303.573µs
    RTT: 361.104µs
    RTT: 306.155µs
    RTT: 405.807µs
    RTT: 313.317µs
    RTT: 403.848µs
    RTT: 315.56µs
    RTT: 386.924µs
    RTT: 379.003µs
    RTT: 378.367µs
    RTT: 331.52µs
    RTT: 444.34µs
    RTT: 354.675µs
    RTT: 346.96µs
    RTT: 482.608µs
    RTT: 297.046µs
    RTT: 214.371µs
    RTT: 373.295µs
    RTT: 422.137µs
    RTT: 358.374µs
    RTT: 374.481µs
    RTT: 371.184µs
    
    opened by dennybritz 11
  • Switch from native-tls to rustls

    Switch from native-tls to rustls

    As someone who has lost a cumulative total of 37 hours (yes, I've been keeping track) every time I've been stalled by a rust build chain that required the native-tls crate, which in turn requires the abomination known as openssl-sys, I would love for my use of the NATS client to not give its consumers this kind of headache.

    Every time you build the native-tls crate in any kind of cross-platform scenario, you have to do so on a machine that has the open SSL source code/header libraries installed for the right target platform and OS and trust me when I say that even having this installed doesn't mean it'll work.

    tl;dr - cross-platform/multi-platform build pipelines become insufferably difficult in the presence of anything that relies on openssl. The rustls crate does not have this problem.

    opened by autodidaddict 11
  • Handle connecting to ipv6 addresses correctly

    Handle connecting to ipv6 addresses correctly

    Previously, it would attempt to use the host from the url, which includes the [] which to_socket_addrs() used directly when resolving which would cause it to fail to resolve. This change change strips the []s.

    Fixes: #322

    Signed-off-by: Jesse Szwedko [email protected]

    opened by jszwedko 10
  • Make use of ìnto_future` for requests and messages

    Make use of ìnto_future` for requests and messages

    Work in progress

    • [x] Makes Client::publish return an into_future based builder
    • [x] Makes Client::request return an into_future based builder.
    • [ ] Makes Context::request return an into_future based builder.
    • [ ] Makes Context::publish return an into_future based builder.
    opened by caspervonb 0
  • Make `consumer::Info.cluster` field optional

    Make `consumer::Info.cluster` field optional

    in #779 cluster field was marked to deserialize with default.

    The proper solution should be cluster: Option<ClusterInfo>, but as it is a breaking change, was not part of patch release. Next non-patch release should include this change.

    good first issue 
    opened by Jarema 0
  • connect coroutine can't terminate

    connect coroutine can't terminate

    Make sure that these boxes are checked before submitting your issue -- thank you!

    • [0.24 ] Included below version and environment information
    • [ ] Included a [Minimal, Complete, and Verifiable example] (https://stackoverflow.com/help/mcve)

    NATS version (grep 'name = "nats"' Cargo.lock -A 1)

    rustc version (rustc --version - we support Rust 1.41 and up)

    OS/Container environment:

    Steps or code to reproduce the issue:

    connect coroutine will leak when retry_on_initial_connect is set and try connect to a wrong address

    pub(crate) async fn connect(&mut self) -> Result<(ServerInfo, Connection), io::Error> { loop { match self.try_connect().await { Ok(inner) => return Ok(inner), Err(error) => { self.events_tx .send(Event::ClientError(ClientError::Other(error.to_string()))) .await .ok(); } } } }

    Expected result:

    get some ways to drop bad Client with wrong server address

    Actual result:

    if we set a wrong addrees,we can't drop the bad Client.

    bug 
    opened by uyugame 1
  • Remove `Stream::purge_subject`

    Remove `Stream::purge_subject`

    Purge subject has become redundant with the into_future based purge builder introduced in https://github.com/nats-io/nats.rs/pull/739.

    Removing in favour of a "one true way" to make the request.

    opened by caspervonb 2
  • Implement `Deserialize` for `ServerAddr`

    Implement `Deserialize` for `ServerAddr`

    Use Case:

    Including NATS connection information in a config file which is deserialized with serde.

    Proposed Change:

    Derive (or otherwise implement) Deserialize on ServerAddr (possibly behind a serde feature).

    Who Benefits From The Change(s)?

    Anyone using serde. Right now, we deserialize the connection URL as a String in our configuration struct, and handle errors due to invalid NATS URLs separately. It would be nice if we could make invalid NATS URLs unrepresentable and handle errors as normal deserialization errors.

    enhancement 
    opened by andrewhalle 0
Releases(async-nats/v0.25.1)
  • async-nats/v0.25.1(Dec 22, 2022)

    Overview

    A hotfix release, changing consumer::Info.cluster to not break serde when cluster is not present (single server mode).

    Fixed

    • Fix cluster field deserialization for consumer info by @Jarema in https://github.com/nats-io/nats.rs/pull/779

    Full Changelog: https://github.com/nats-io/nats.rs/compare/async-nats/v0.25.0...async-nats/v0.25.1

    Source code(tar.gz)
    Source code(zip)
  • async-nats/v0.25.0(Dec 20, 2022)

    Overview

    This release focuses on service module, which leverages NATS primitives to provide API for creating and running horizontaly scalable microservices.

    let client = async_nats::connect(server.client_url()).await.unwrap();
    
    let mut service = client
        .add_service(async_nats::service::Config {
            name: "serviceA".to_string(),
            version: "1.0.0".to_string(),
            endpoint: "service_a".to_string(),
            schema: None,
            description: None,
        })
        .await?;
        
       while let Some(request) = service.next().await {
           request.respond(Ok("data".into())).await.unwrap();
    }
    

    As this is an experimental beta feature, to enable it, please add experimental feature to Cargo.toml NATS import.

    Added

    • Add Service API by @Jarema in https://github.com/nats-io/nats.rs/pull/748
    • Ordered and convenient HeaderValue reported by @cortopy, implemented by @Jarema in https://github.com/nats-io/nats.rs/pull/767

    Changed

    • Always reset periodic flush interval after manual flush by @caspervonb in https://github.com/nats-io/nats.rs/pull/747
    • Fuse the pull consumer Stream after terminal error by @Jarema in https://github.com/nats-io/nats.rs/pull/751
    • Remove auth_required comment by @Jarema in https://github.com/nats-io/nats.rs/pull/763
    • Change JetStream request timeout to 5 seconds by @Jarema in https://github.com/nats-io/nats.rs/pull/772

    Full Changelog: https://github.com/nats-io/nats.rs/compare/async-nats/v0.24.0...async-nats/v0.25.0

    Source code(tar.gz)
    Source code(zip)
  • async-nats/v0.24.0(Nov 26, 2022)

    Overview

    This a minor release intended to release all changes before the long-awaited changes around concrete errors land.

    What's Changed

    • Fix various spelling mistakes by @c0d3x42 in https://github.com/nats-io/nats.rs/pull/735
    • Add spellcheck by @Jarema in https://github.com/nats-io/nats.rs/pull/736
    • Reset flush interval after ping forces flush by @caspervonb in https://github.com/nats-io/nats.rs/pull/737
    • Add extended purge by @Jarema in https://github.com/nats-io/nats.rs/pull/739

    Full Changelog: https://github.com/nats-io/nats.rs/compare/async-nats/v0.23.0...async-nats/v0.24.0

    Source code(tar.gz)
    Source code(zip)
  • async-nats/v0.23.0(Nov 18, 2022)

    Overview

    This release focuses on fixes around Object Store and customized JetStream Publish.

    It also introduces a breaking change, as not all publish() methods did return PublishError, using the generic async_nats::Error instead. This has been fixed.

    Breaking changes

    • Make publish error types consistent by @Jarema in https://github.com/nats-io/nats.rs/pull/727

    Fixed

    • Fix object store watch to retrieve only new/changed values by @Jarema in https://github.com/nats-io/nats.rs/pull/720
    • Fix stack overflow in object store by @Jarema in https://github.com/nats-io/nats.rs/pull/731

    Added

    • Add customizable JetStream publish by @Jarema in https://github.com/nats-io/nats.rs/pull/728 request by @andrenth
    • Add object store list by @Jarema in https://github.com/nats-io/nats.rs/pull/721
    • Add docs lint by @Jarema in https://github.com/nats-io/nats.rs/pull/725

    Changed

    • Use debug macro for logging instead of println by @c0d3x42 in https://github.com/nats-io/nats.rs/pull/716
    • Merge periodic flush into connection handler loop by @caspervonb in https://github.com/nats-io/nats.rs/pull/687
    • Improve docs formatting and fix links by @Jarema in https://github.com/nats-io/nats.rs/pull/723

    New Contributors

    • @c0d3x42 made their first contribution in https://github.com/nats-io/nats.rs/pull/716
    • @piotrpio made their first contribution in https://github.com/nats-io/nats.rs/pull/728

    Full Changelog: https://github.com/nats-io/nats.rs/compare/async-nats/v0.22.1...async-nats/v0.23.0

    Source code(tar.gz)
    Source code(zip)
  • nats/v0.23.1(Nov 11, 2022)

    Overview

    This is a minor sync client release with fixes to Object Store API

    Fixed

    • Fix sync object store encoding by @Jarema in https://github.com/nats-io/nats.rs/pull/700

    Added

    • Add digest to sync object store by @Jarema in https://github.com/nats-io/nats.rs/pull/709

    Full Changelog: https://github.com/nats-io/nats.rs/compare/nats/v0.23.0...nats/v0.23.1

    Source code(tar.gz)
    Source code(zip)
  • async-nats/v0.22.1(Nov 11, 2022)

    Overview

    A patch release, including early feedback to 0.22.0.

    Breaking Changes

    Unfortunately, the last release included a typo in retry_on_initial_release. This patch fixes it. We decided to make a regular patch release without yanking as we're a pre 1.0.0 version. To avoid similar situations in the future, spellcheck lint will be added before the next release.

    Changed

    • Flush on publish ack await by @Jarema in https://github.com/nats-io/nats.rs/pull/708

    Fixed

    • Fix typo in retry_on_initial_connect by @Jarema in https://github.com/nats-io/nats.rs/pull/713

    Added

    • Setup cargo deny to check licenses by @corbinu in https://github.com/nats-io/nats.rs/pull/703
    Source code(tar.gz)
    Source code(zip)
  • async-nats/v0.22.0(Nov 8, 2022)

    Overview

    This release introduces a number of changes and two breaking changes:

    JetStream publish

    Used to return ack:

    let ack = jetstream.publish().await.unwrap();
    

    But while adding publish that does not wait for an acknowledgement before returning, we realized that we can leverage IntoFuture, so the new api is:

    // This publishes the message, but do not wait until ack is received.
    let future_ack = jetstream.publish().await.unwrap();
    // to receive the acknowledge, `await()` the returned value:
    let ack = future_ack.await().unwrap();
    

    Event logging

    After adding the initial retry on connect option, Event::Reconnect didn't make much sense. Hence it was renamed to Event::Connected, which describes the current state without implications about the previous one. For consistency, Event::Disconnect was renamed to Event::Disconnected.

    Breaking changes

    • Defer publish acknowledgements by @Jarema in https://github.com/nats-io/nats.rs/pull/644
    • Improve event logging by @Jarema in https://github.com/nats-io/nats.rs/pull/672

    Added

    • Add support for mirrors and sources in Key Value Store by @Jarema in https://github.com/nats-io/nats.rs/pull/676
    • Add sources and mirror to stream config by @Jarema in https://github.com/nats-io/nats.rs/pull/673
    • Add retry on initial connect by @Jarema in https://github.com/nats-io/nats.rs/pull/662
    • Add docs to client methods by @Jarema in https://github.com/nats-io/nats.rs/pull/664
    • Add license to nats-server wrapper by @Jarema in https://github.com/nats-io/nats.rs/pull/704

    Fixed

    • Fix object store bucket names by @Jarema in https://github.com/nats-io/nats.rs/pull/697
    • Fix event connected display by @Jarema in https://github.com/nats-io/nats.rs/pull/669
    • Fix missing hearbeats future wakup by @Jarema in https://github.com/nats-io/nats.rs/pull/671
    • Fix pull consumer without hearbeats by @Jarema in https://github.com/nats-io/nats.rs/pull/667
    • Fix typos in async-nats docs by @jdon in https://github.com/nats-io/nats.rs/pull/663
    • Fix clippy errors by @caspervonb in https://github.com/nats-io/nats.rs/pull/690
    • Fix broken clippy pipeline and errors by @caspervonb in https://github.com/nats-io/nats.rs/pull/695

    Changed

    • Bump rustls-pemfile version by @paulgb in https://github.com/nats-io/nats.rs/pull/666
    • Use get direct in KV by @Jarema in https://github.com/nats-io/nats.rs/pull/651
    • Ordered consumer recreate & use mem_storage R1 by @Jarema in https://github.com/nats-io/nats.rs/pull/654
    • Change event logs to info level by @Jarema in https://github.com/nats-io/nats.rs/pull/677
    • Remove unused dependency on tokio-util by @caspervonb in https://github.com/nats-io/nats.rs/pull/679
    • Merge periodic ping into connection handler loop by @caspervonb in https://github.com/nats-io/nats.rs/pull/681
    • Update K/V purge documentation verbiage by @corbinu in https://github.com/nats-io/nats.rs/pull/688
    • Make pull consumer having exact pending numbers by @Jarema in https://github.com/nats-io/nats.rs/pull/668
    • Improve object get example by @Jarema in https://github.com/nats-io/nats.rs/pull/706

    New Contributors

    • @jdon made their first contribution in https://github.com/nats-io/nats.rs/pull/663
    • @corbinu made their first contribution in https://github.com/nats-io/nats.rs/pull/688

    Full Changelog: https://github.com/nats-io/nats.rs/compare/async-nats/v0.21.0...async-nats/v0.22.0

    Source code(tar.gz)
    Source code(zip)
  • async-nats/v0.21.0(Oct 6, 2022)

    Overview

    This release's highlight is added support for Object Store.

    Breaking changes

    • Add last_active to SequenceInfo and rename SequencePair to SequenceInfo by @Jarema in https://github.com/nats-io/nats.rs/pull/657

    Added

    • Add Object Store by @Jarema in https://github.com/nats-io/nats.rs/pull/655
    • Add discard_new_per_subject to Stream by @Jarema in https://github.com/nats-io/nats.rs/pull/656
    • Add republish to KV by @Jarema in https://github.com/nats-io/nats.rs/pull/653
    • Add name option by @Jarema in https://github.com/nats-io/nats.rs/pull/659

    Fixed

    • Fix empty keys deadlock (found by @segfaultdoc ) by @Jarema in https://github.com/nats-io/nats.rs/pull/641
    • Fix lint error by @Jarema in https://github.com/nats-io/nats.rs/pull/645
    • Fix benchmark in CI by @Jarema in https://github.com/nats-io/nats.rs/pull/647
    • Fix potential pending pings mismatch on reconnects (found by @zrus ) by @Jarema in https://github.com/nats-io/nats.rs/pull/650
    • Fix typo (eror -> error) by @paulgb in https://github.com/nats-io/nats.rs/pull/652
    • Remove println by @Jarema in https://github.com/nats-io/nats.rs/pull/658

    Full Changelog: https://github.com/nats-io/nats.rs/compare/async-nats/v0.20.0...async-nats/v0.21.0

    Source code(tar.gz)
    Source code(zip)
  • async-nats/v0.20.0(Sep 16, 2022)

    Overview

    This release focuses on KV and 2.9 nats-server features.

    Added

    • Add Key Value by @Jarema and @caspervonb in https://github.com/nats-io/nats.rs/pull/586
    • Add Direct get by @Jarema in https://github.com/nats-io/nats.rs/pull/636
    • Add timeout to request & request builder by @Jarema in https://github.com/nats-io/nats.rs/pull/616
    • Add memory storage option to consumers by @Jarema in https://github.com/nats-io/nats.rs/pull/638
    • Add Consumer name by @Jarema in https://github.com/nats-io/nats.rs/pull/637

    Fixed

    • Fix heartbeat typo by @Jarema in https://github.com/nats-io/nats.rs/pull/630

    What's Changed

    • Headers refactor by @Jarema in https://github.com/nats-io/nats.rs/pull/629
    • Use new Consumer API by @Jarema in https://github.com/nats-io/nats.rs/pull/637

    Full Changelog: https://github.com/nats-io/nats.rs/compare/async-nats/v0.19.0...async-nats/v0.20.0

    Source code(tar.gz)
    Source code(zip)
  • async-nats/v0.19.0(Sep 2, 2022)

    Overview

    This release is focused on resilience of the client against network issues.

    It also adds some utility methods, Stream Republish and improvements for Pull Consumers.

    Added

    • Add server info by @Jarema in https://github.com/nats-io/nats.rs/pull/600
    • Add server compatibility check function by @Jarema in https://github.com/nats-io/nats.rs/pull/603
    • Add stream info and cached_info by @Jarema in https://github.com/nats-io/nats.rs/pull/599
    • Add custom request prefix option by @Jarema in https://github.com/nats-io/nats.rs/pull/604
    • Add connection timeout by @thed0ct0r in https://github.com/nats-io/nats.rs/pull/607
    • Add stream republish by @Jarema in https://github.com/nats-io/nats.rs/pull/613
    • Add timeout to double_ack by @Jarema in https://github.com/nats-io/nats.rs/pull/617
    • Add internal connection state watcher by @Jarema in https://github.com/nats-io/nats.rs/pull/606
    • Add miss Pull Consumer heartbeats error by @Jarema in https://github.com/nats-io/nats.rs/pull/627
    • Add purge subject by @Jarema in https://github.com/nats-io/nats.rs/pull/620

    Fixed

    • Fix jetstream reconnect by @Jarema in https://github.com/nats-io/nats.rs/pull/610
    • Fix typos in readme's by @insmo in https://github.com/nats-io/nats.rs/pull/618
    • Fix voldemort error by @Jarema in https://github.com/nats-io/nats.rs/pull/626
    • Jarema/fix pull consumer deadlock by @Jarema in https://github.com/nats-io/nats.rs/pull/619

    Thanks to all contributors for helping out, taking part in discussion and detailed issue reports!

    New Contributors

    • @thed0ct0r made their first contribution in https://github.com/nats-io/nats.rs/pull/607
    • @insmo made their first contribution in https://github.com/nats-io/nats.rs/pull/618

    Full Changelog: https://github.com/nats-io/nats.rs/compare/async-nats/v0.18.0...async-nats/v0.19.0

    Source code(tar.gz)
    Source code(zip)
  • async-nats/v0.18.0(Aug 7, 2022)

    Overview

    This release focuses on fixes and improvements, with addition of ordered Push Consumer for async-nats crate and callback refactor.

    async-nats

    Breaking Changes

    • Refactor callbacks by @Jarema in https://github.com/nats-io/nats.rs/pull/595

    New callbacks approach is simpler to use. Consider below example:

    #[tokio::main]
    async fn main() -> std::io::Result<()> {
    async_nats::ConnectOptions::new().event_callback(|event| async move {
    	// listen on specific event
            if let async_nats::Event::Reconnect = event {
                println!("reconnected");
            }
    	// or match for all events
    	match event {
    		async_nats::Event::Disconnect => println!("disconnected"),
    		async_nats::Event::Reconnect => println!("reconnected"),
    		async_nats::Event::ClientError(err) => println!("client error occured: {}", err);
    	}
    }).connect("demo.nats.io").await?;
    # Ok(())
    }
    
    

    Added

    • Add get_last_raw_message_by_subject to Stream by @caspervonb in https://github.com/nats-io/nats.rs/pull/584

    • Add ClusterInfo and PeerInfo by @Jarema in https://github.com/nats-io/nats.rs/pull/572

    • Add ordered push consumer by @Jarema in https://github.com/nats-io/nats.rs/pull/574

    • Add concurrent example by @Jarema in https://github.com/nats-io/nats.rs/pull/580

    • Add delete message from stream by @Jarema in https://github.com/nats-io/nats.rs/pull/588

    • Add Nkey authorization support by @neogenie https://github.com/nats-io/nats.rs/pull/593

    Fixed

    • Fix ordered consumer after discard policy hit by @Jarema in https://github.com/nats-io/nats.rs/pull/585
    • Fix pull consumer stream method when batch is set to 1 by @Jarema in https://github.com/nats-io/nats.rs/pull/590
    • Fix reconnect auth deadlock by @caspervonb in https://github.com/nats-io/nats.rs/pull/578

    nats

    Added

    • Add cluster to streaminfo/consumerinfo struct by @j13tw in https://github.com/nats-io/nats.rs/pull/537

    New Contributors

    • @j13tw made their first contribution in https://github.com/nats-io/nats.rs/pull/537
    • @neogenie made their first contribution in https://github.com/nats-io/nats.rs/pull/593

    Once again, we can thank you enough for your contributions. It helps so much with the development and maintenance of the libraries!

    Full Changelog: https://github.com/nats-io/nats.rs/compare/async-nats/v0.17.0...async-nats/v0.18.0

    Source code(tar.gz)
    Source code(zip)
  • async-nats/v0.17.0(Jul 13, 2022)

    Overview

    This release focuses on two main things:

    • Refactor of JetStream API
    • Fix of slow connect (thanks @brooksmtownsend for reporting this!)

    The changes in JetStream API make usage of builder more intuitive and seamless. Before, you had to call

    // before changes
    let messages = consumer.stream().await?;
    // or use a shortcut
    let messages = consumer.messages().await?;
    
    // after changes
    let messages = consumer.stream().messages().await?;
    // or with options
    let messages = consumer.stream().max_bytes_per_bytes(1024).messages().await?;
    

    Changed

    • Rename push consumer Stream iterator to Messages by @caspervonb in https://github.com/nats-io/nats.rs/pull/566
    • Add pull builder for Fetch and Batch by @Jarema in https://github.com/nats-io/nats.rs/pull/565

    Fixed

    • Fix slow connect in no-auth scenarios by @Jarema in https://github.com/nats-io/nats.rs/pull/568

    Other

    • Fix license headers by @Jarema in https://github.com/nats-io/nats.rs/pull/564
    • Add missing module docs headers by @Jarema in https://github.com/nats-io/nats.rs/pull/563
    • Remove fault injection run from workflow by @caspervonb in https://github.com/nats-io/nats.rs/pull/567

    Full Changelog: https://github.com/nats-io/nats.rs/compare/async-nats/v0.16.0...async-nats/v0.17.0

    Source code(tar.gz)
    Source code(zip)
  • async-nats/v0.16.0(Jul 10, 2022)

    async-nats. v0.16.0

    This release features a lot of improvements and additions to JetStream API and adds Push Consumer.

    Added

    • Add query_account to jetstream::Context by @caspervonb in https://github.com/nats-io/nats.rs/pull/528
    • Add streams to push consumers by @caspervonb in https://github.com/nats-io/nats.rs/pull/527
    • Add no_echo option by @Jarema in https://github.com/nats-io/nats.rs/pull/560
    • Add jetstream::Stream::get_raw_message by @caspervonb in https://github.com/nats-io/nats.rs/pull/484
    • Add Pull Consumer builder by @Jarema in https://github.com/nats-io/nats.rs/pull/541

    Changed

    • Allow unknown directives to be skipped when parsing by @caspervonb in https://github.com/nats-io/nats.rs/pull/514
    • Narrow error type returned from client publishing by @caspervonb in https://github.com/nats-io/nats.rs/pull/525
    • Change create_consumer to return Consumer by @Jarema in https://github.com/nats-io/nats.rs/pull/544
    • Switch webpki to rustls-native-certs by @Jarema in https://github.com/nats-io/nats.rs/pull/558
    • Normalize error type used in subscribe methods by @caspervonb in https://github.com/nats-io/nats.rs/pull/524
    • Optimize jetstream::consumer::pull::Consumer::stream method. by @Jarema in https://github.com/nats-io/nats.rs/pull/529
    • Make deliver_subject required for push::Config by @caspervonb in https://github.com/nats-io/nats.rs/pull/531

    Fixed

    • Handle missing error cases in Stream by @Jarema in https://github.com/nats-io/nats.rs/pull/542
    • Handle connecting to ipv6 addresses correctly by @jszwedko in https://github.com/nats-io/nats.rs/pull/386

    Other

    • Move Client into its own source file by @caspervonb in https://github.com/nats-io/nats.rs/pull/523
    • Extract jetstream::Message into its own module by @caspervonb in https://github.com/nats-io/nats.rs/pull/534
    • Normalize introduction example by @caspervonb in https://github.com/nats-io/nats.rs/pull/540
    • Fix documentation links by @Jarema in https://github.com/nats-io/nats.rs/pull/547
    • Add more documentation to Pull Consumer by @Jarema in https://github.com/nats-io/nats.rs/pull/546
    • Add Push Consumer stream docs by @Jarema in https://github.com/nats-io/nats.rs/pull/559
    • Fix ack test race by @Jarema in https://github.com/nats-io/nats.rs/pull/555
    • Add Message and Headers docs by @Jarema in https://github.com/nats-io/nats.rs/pull/548
    • Remove trace and debug from nats-server wrapper by @Jarema in https://github.com/nats-io/nats.rs/pull/550

    nats v0.22.0

    This is a minor release for the nats client with one fix and several documentation improvements.

    What's changed

    • Handle connecting to ipv6 addresses correctly by @jszwedko in https://github.com/nats-io/nats.rs/pull/386
    • Use correct flush_timeout operation in doc test by @krady21 in https://github.com/nats-io/nats.rs/pull/556
    • Fix typo in jetstream/pull_subscription.rs by @bbigras in https://github.com/nats-io/nats.rs/pull/521

    New Contributors

    • @bbigras made their first contribution in https://github.com/nats-io/nats.rs/pull/521
    • @jszwedko made their first contribution in https://github.com/nats-io/nats.rs/pull/386
    • @krady21 made their first contribution in https://github.com/nats-io/nats.rs/pull/556

    Huge thanks to all contributors. Your help, feedback and insights allows us to drive this library with confidence and speed!

    Full Changelog: https://github.com/nats-io/nats.rs/compare/async-nats/v0.15.0...async-nats/v0.16.0

    Source code(tar.gz)
    Source code(zip)
  • async-nats/v0.15.0(Jun 17, 2022)

    Overview

    This release is the first JetStream 🍾 feature set for async-nats!

    It includes:

    • New simplified JetStream API approach
    • JetStream Publish
    • Streams management
    • Consumers Management
    • Pull Consumers implementation
    • Ack's

    This is an experimental release of JetStream (simplified) API. It may change, and it may have bugs. We appreciate any feedback and contributions to help it reach maturity soon!

    For nats client, authentication with token was added by @paulgb

    async-nats

    Added

    • Add JetStream types and basics by @Jarema in https://github.com/nats-io/nats.rs/pull/457
    • Add get stream by @Jarema in https://github.com/nats-io/nats.rs/pull/458
    • Add jetstream stream delete and stream update by @Jarema in https://github.com/nats-io/nats.rs/pull/459
    • Add async_nats::jetstream::Context::publish by @caspervonb in https://github.com/nats-io/nats.rs/pull/460
    • Add get_or_create JetStream management API by @Jarema in https://github.com/nats-io/nats.rs/pull/467
    • Add domain and prefix by @Jarema in https://github.com/nats-io/nats.rs/pull/490
    • Add error codes to Response::Error variant by @caspervonb in https://github.com/nats-io/nats.rs/pull/496
    • Add JetStream ACK by @Jarema in https://github.com/nats-io/nats.rs/pull/515
    • Add convinience methods to Consumer management by @Jarema in https://github.com/nats-io/nats.rs/pull/481
    • Add Pull Consumer by @Jarema in https://github.com/nats-io/nats.rs/pull/479
    • Add create consumer by @Jarema in https://github.com/nats-io/nats.rs/pull/471
    • Add Consumer::info and Consumer::cached_info by @Jarema in https://github.com/nats-io/nats.rs/pull/510
    • Introduce a StatusCode type to represent statuses by @caspervonb in https://github.com/nats-io/nats.rs/pull/474
    • Add example for multiple pub/subs in tasks by @Jarema in https://github.com/nats-io/nats.rs/pull/453
    • Implement jetstream requests by @caspervonb in https://github.com/nats-io/nats.rs/pull/435
    • Add async_nats::jetstream::Context::publish_with_headers by @caspervonb in https://github.com/nats-io/nats.rs/pull/462
    • Implement From<jetstream::Message> for Message by @caspervonb in https://github.com/nats-io/nats.rs/pull/512
    • Add get_or_create_consumer and delete_consumer by @Jarema in https://github.com/nats-io/nats.rs/pull/475
    • Have No async-stream dependant implementation for Pull Consumers by @caspervonb in https://github.com/nats-io/nats.rs/pull/499

    Changed

    • Do not flush in write calls by @caspervonb in https://github.com/nats-io/nats.rs/pull/423
    • Only retain non-closed subscriptions on reconnect by @caspervonb in https://github.com/nats-io/nats.rs/pull/454

    Fixed

    • Fix off by one error that can occur parsing "HMSG" by @caspervonb in https://github.com/nats-io/nats.rs/pull/513
    • Removed attempt to connect to server info host when TLS is enabled by @brooksmtownsend in https://github.com/nats-io/nats.rs/pull/500

    nats

    Added

    • Allow tokens in connection strings and add tests by @paulgb in https://github.com/nats-io/nats.rs/pull/506

    New Contributors

    • @brooksmtownsend made their first contribution in https://github.com/nats-io/nats.rs/pull/500
    • @paulgb made their first contribution in https://github.com/nats-io/nats.rs/pull/506

    Thanks to all contributors! Your work is very appreciated!

    Full Changelog: https://github.com/nats-io/nats.rs/compare/async-nats/v0.14.0...async-nats/v0.15.0

    Source code(tar.gz)
    Source code(zip)
  • async-nats/v0.14.0(May 25, 2022)

    Overview

    This release contains a set of internal codebase behavior improvements, missing elements for JetStream features found out while working on it and some user-facing features.

    Added

    • Add no responders handling by @Jarema in https://github.com/nats-io/nats.rs/pull/450
    • Add client jwt authentication by @stevelr in https://github.com/nats-io/nats.rs/pull/433
    • Add lame duck mode support by @Jarema in https://github.com/nats-io/nats.rs/pull/438
    • Add slow consumers by @Jarema in https://github.com/nats-io/nats.rs/pull/444
    • Add tracking maximum number of pending pings by @caspervonb https://github.com/nats-io/nats.rs/pull/419

    Changed

    • Client doesn't need to be mutable self by @stevelr in https://github.com/nats-io/nats.rs/pull/434
    • Make send buffer configurable by @Jarema in https://github.com/nats-io/nats.rs/pull/437

    Thanks, @stevelr for your contributions!

    Full Changelog: https://github.com/nats-io/nats.rs/compare/nats/v0.13.0...async-nats/v0.14.0

    Source code(tar.gz)
    Source code(zip)
  • nats/v0.20.1(May 23, 2022)

    Overview

    A patch release fixing stack overflow happening when there was kv watcher for a key that did not change for a long time.

    Fixed

    • Remove recursive calls by @segfaultdoc in https://github.com/nats-io/nats.rs/pull/448

    New Contributors

    • @segfaultdoc made their first contribution in https://github.com/nats-io/nats.rs/pull/448

    Full Changelog: https://github.com/nats-io/nats.rs/compare/nats/v0.20.0...nats/v0.20.1

    Source code(tar.gz)
    Source code(zip)
  • nats/v0.20.0(May 9, 2022)

    Overview

    A minor sync client release adding requests with timeouts and headers.

    Added

    • Add request with headers and timeouts by @Jarema in https://github.com/nats-io/nats.rs/pull/431

    Full Changelog: https://github.com/nats-io/nats.rs/compare/nats/v0.19.1...nats/v0.20.0

    Source code(tar.gz)
    Source code(zip)
  • async-nats/v0.13.0(May 5, 2022)

    Overview

    This time around it's just async-nats Client release.

    Its most important part is headers support which enables work around JetStream that first PRs should show up in next release.

    Added

    • Add Auth - username/password & token by @Jarema in https://github.com/nats-io/nats.rs/pull/408
    • Support sending and receiving messages with headers by @caspervonb in https://github.com/nats-io/nats.rs/pull/402
    • Add async server errors callbacks by @Jarema in https://github.com/nats-io/nats.rs/pull/397
    • Discover additional servers via INFO by @caspervonb in https://github.com/nats-io/nats.rs/pull/403
    • Resolve socket addresses during connect by @caspervonb in https://github.com/nats-io/nats.rs/pull/403

    Changed

    • Wait between reconnection attempts by @caspervonb in https://github.com/nats-io/nats.rs/pull/407
    • Limit connection attempts by @caspervonb in https://github.com/nats-io/nats.rs/pull/400

    Other

    • Remove redundant doctests by @Jarema in https://github.com/nats-io/nats.rs/pull/412
    • Fix connection callback tests by @Jarema in https://github.com/nats-io/nats.rs/pull/420

    Full Changelog: https://github.com/nats-io/nats.rs/compare/async-nats/v0.12.0...async-nats/v0.13.0

    Source code(tar.gz)
    Source code(zip)
  • async-nats/v0.12.0(Apr 28, 2022)

    Overview

    This is a double release. Most work has been done around the async-nats client. nats client got a fix around Key Value.

    async-nats v0.12.0

    This release adds a few features accompanied by some architecture overhauls in preparation for JetStream support and good maintainability of the codebase.

    Added

    • Add more examples and docs by @Jarema in https://github.com/nats-io/nats.rs/pull/372
    • Add unsubscribe by @Jarema in https://github.com/nats-io/nats.rs/pull/363
    • Add unsubscribe after by @Jarema in https://github.com/nats-io/nats.rs/pull/385
    • Add queue subscriber and unit test by @stevelr in https://github.com/nats-io/nats.rs/pull/388
    • Implement reconnect by @caspervonb in https://github.com/nats-io/nats.rs/pull/382

    Other

    • Fix test linter warnings by @caspervonb in https://github.com/nats-io/nats.rs/pull/379
    • Fix tests failing with nats-server 2.8.0 by @Jarema in https://github.com/nats-io/nats.rs/pull/380
    • Use local server for documentation tests by @caspervonb in https://github.com/nats-io/nats.rs/pull/377
    • Improve workflow caching by @caspervonb in https://github.com/nats-io/nats.rs/pull/381
    • Fix typo in README.md by @mgrachev in https://github.com/nats-io/nats.rs/pull/384
    • Internal Architecture overhaul by @caspervonb and @Jarema

    nats v0.19.1

    Only one fix around this time, as most work is focused around the async client.

    Fixed

    • Fix KV issues when JS domain is set by @thomastaylor312 in https://github.com/nats-io/nats.rs/pull/387

    Contributors

    • @mgrachev in https://github.com/nats-io/nats.rs/pull/384
    • @stevelr in https://github.com/nats-io/nats.rs/pull/388
    • @thomastaylor312 in https://github.com/nats-io/nats.rs/pull/387

    Big thanks to all contributors! Your input is invaluable!

    Full Changelog: https://github.com/nats-io/nats.rs/compare/async-nats/v0.11.0...async-nats/v0.12.0

    Source code(tar.gz)
    Source code(zip)
  • async-nats/v0.11.0(Apr 17, 2022)

    Overview

    This is a double release. First and foremost, the new async-nats Crate become available, as a bleeding edge beta release. Secondly, a minor nats crate.

    Please also note that the repository has been reorganized into a workspace, with the nats directory being the old synchronous NATS Crate and async-nats being the new one.

    New async-client v0.11.0

    This was in the works for quite some time, focused on having a performant, easy-to both use and maintain, idiomatic async Rust NATS client. This is a bleeding-edge beta release to bring some visibility, get your feedback and enable transparency and contributions.

    The versioning starts from v0.11.0, as the crate was used a long time ago by NATS.io org for some former work around the async client.

    What it already does:

    • fully native tokio implementation
    • async-std tokio compact mode working out of the box without performance penalty
    • Core NATS Protocol support
    • TLS with and without client auth
    • publish
    • subscribe
    • request/response
    • Clonable Client
    • subscriptions as streams

    What is missing (Core NATS)

    • authorization via Options
    • Errors (those sent by the server) callbacks/streams
    • reconnections
    • no responders handling
    • lame duck mode

    Next steps

    In the following days, all missing features will be added, and work on Jetstream support will initiate.

    Thanks

    Discussions around the architecture of the async client were long and fruitful. We would like to thank you all for that efforts. Especially those participating in https://github.com/nats-io/nats.rs/discussions/298 discussion, @stevelr and @MattesWhite.

    nats client release v0.19.0

    Changed

    • Bump nuid dependency to 0.3.1 by @mfelsche in https://github.com/nats-io/nats.rs/pull/325
    • Adapt discard policy according to server version by @Jarema in https://github.com/nats-io/nats.rs/pull/327
    • Link to asynk module instead of async-nats by @aditsachde in https://github.com/nats-io/nats.rs/pull/331
    • Remove Features section from Readme.md by @Jarema in https://github.com/nats-io/nats.rs/pull/335
    • upgrade itoa, nkeys, parking_lot, regex by @attila-lin in https://github.com/nats-io/nats.rs/pull/330

    Fixed

    • Fix a couple of minor things by @caspervonb in https://github.com/nats-io/nats.rs/pull/338
    • Fix clippy warning by @caspervonb in https://github.com/nats-io/nats.rs/pull/361

    New Contributors

    • @mfelsche made their first contribution in https://github.com/nats-io/nats.rs/pull/325
    • @aditsachde made their first contribution in https://github.com/nats-io/nats.rs/pull/331
    • @attila-lin made their first contribution in https://github.com/nats-io/nats.rs/pull/330

    Full Changelog: https://github.com/nats-io/nats.rs/compare/v0.18.1...async-nats/v0.11.0

    Source code(tar.gz)
    Source code(zip)
  • v0.18.1(Feb 11, 2022)

    Overview

    A patch release fixing long durations until close() returned. It was introduced in the graceful shutdown of client connection threads in v0.18.0. Dropping NATS connection was not affected.

    Fixed

    • Fix slow connection closing by @Jarema in https://github.com/nats-io/nats.rs/pull/319
    • Fix close() hang after js.subscribe() is called by @Jarema https://github.com/nats-io/nats.rs/pull/321
    • Fix close() hang after Push Consumer subsription edge case by @Jarema https://github.com/nats-io/nats.rs/pull/323

    Minor

    • Replace custom Into trait with From by @Jarema in https://github.com/nats-io/nats.rs/pull/315

    Full Changelog: https://github.com/nats-io/nats.rs/compare/v0.18.0...v0.18.1

    Source code(tar.gz)
    Source code(zip)
  • v0.18.0(Feb 8, 2022)

    Overview

    This release focuses mainly around fixes of large changes introduces in 0.17.0, but also adds slow consumers support and improves the header map interface.

    Breaking Change

    • Add a public convenience interface to header maps by @caspervonb in https://github.com/nats-io/nats.rs/pull/310

    Added

    • Add slow consumers support by @Jarema in https://github.com/nats-io/nats.rs/pull/299

    Changed

    • Replace chrono with time due to RUSTSEC-2020-0159 by @ShellWowza in https://github.com/nats-io/nats.rs/pull/309
    • Join all connect threads while closing connection by @Jarema in https://github.com/nats-io/nats.rs/pull/305

    Fixed

    • Test server subject matching bug fix by @fdlg in https://github.com/nats-io/nats.rs/pull/221
    • Fix Pull Subscriber visibility by @Jarema in https://github.com/nats-io/nats.rs/pull/313
    • Fix missing export subscription modules by @caspervonb in https://github.com/nats-io/nats.rs/pull/314
    • Check sequence mismatch only for Ordered Consumer by @Jarema in https://github.com/nats-io/nats.rs/pull/317

    New Contributors

    • @ShellWowza made their first contribution in https://github.com/nats-io/nats.rs/pull/309
    • @fdlg made their first contribution in https://github.com/nats-io/nats.rs/pull/221

    Full Changelog: https://github.com/nats-io/nats.rs/compare/v0.17.0...v0.18.0

    Source code(tar.gz)
    Source code(zip)
  • v0.17.0(Jan 21, 2022)

    Overview

    This release brings a lot of changes and refactors among which the highlights are:

    • A complete rewrite of the JetStream API with a new subscription interface
    • Improvements of JetStream internals
    • Key-Value Store support
    • Object Store support

    Breaking Changes

    • Introduce a JetStream type by @caspervonb in https://github.com/nats-io/nats.rs/pull/247
    • Move Consumer Management to JetStream by @Jarema in https://github.com/nats-io/nats.rs/pull/250
    • Re-work JetStream push consumer interface by @caspervonb in https://github.com/nats-io/nats.rs/pull/252
    • Re-work JetStream pull consumer interface by @Jarema in https://github.com/nats-io/nats.rs/pull/302
    • Rename create_stream to add_stream by @Jarema in https://github.com/nats-io/nats.rs/pull/251
    • Change return type of add_consumer to ConsumerInfo by @caspervonb in https://github.com/nats-io/nats.rs/pull/252

    Added

    • Add header module by @caspervonb in https://github.com/nats-io/nats.rs/pull/260
    • Implement key-value store by @caspervonb in https://github.com/nats-io/nats.rs/pull/267
    • Implement object store by @caspervonb in https://github.com/nats-io/nats.rs/pull/269
    • Lame duck mode support by @Jarema in https://github.com/nats-io/nats.rs/pull/265
    • Add domain field to PubAck by @caspervonb in https://github.com/nats-io/nats.rs/pull/243
    • Add support for JetStream publishing by @caspervonb in https://github.com/nats-io/nats.rs/pull/248
    • Add error_callback by @derekcollison in https://github.com/nats-io/nats.rs/pull/253
    • Add get_message to JetStream context by @caspervonb in https://github.com/nats-io/nats.rs/pull/267
    • Add get_last_message to JetStream context by @caspervonb in https://github.com/nats-io/nats.rs/pull/267
    • Add option retry_on_failed_connect by @pozsgaic in https://github.com/nats-io/nats.rs/pull/223
    • Add support for different .pem contents by @Jarema https://github.com/nats-io/nats.rs/pull/280
    • Introduce ServerAddress by @MattesWhite in https://github.com/nats-io/nats.rs/pull/276

    Changed

    • Allow for inline header description with spaces by @caspervonb in https://github.com/nats-io/nats.rs/pull/241
    • Allow setting a jetstream api prefix from a domain by @caspervonb in https://github.com/nats-io/nats.rs/pull/244
    • Have Client in Message as Option by @Jarema in https://github.com/nats-io/nats.rs/pull/258
    • Change jetstream log level to debug by @caspervonb https://github.com/nats-io/nats.rs/pull/307
    • Bump MSRV to 1.53.0

    Minor

    • Reduce allocations in Headers::try_from by @caspervonb in https://github.com/nats-io/nats.rs/pull/238
    • Improve error handling by @caspervonb in https://github.com/nats-io/nats.rs/pull/249
    • Some additions.. by @derekcollison in https://github.com/nats-io/nats.rs/pull/253
    • Bump blocking crate by @Jarema in https://github.com/nats-io/nats.rs/pull/255
    • Add sealed field to jetstream::StreamConfig by @caspervonb in https://github.com/nats-io/nats.rs/pull/256
    • Fix unsubscribe method behavior to act as in docs by @Jarema in https://github.com/nats-io/nats.rs/pull/301
    • Fix license formatting so it is properly detected by Github and add missing license banners in files by @Jarema in https://github.com/nats-io/nats.rs/pull/292
    • Fix Object read and object_store tests by @stevelr and @Jarema https://github.com/nats-io/nats.rs/pull/282

    Big Thanks to our contributors: @stevelr @MattesWhite and @pozsgaic!

    Full Changelog: https://github.com/nats-io/nats.rs/compare/v0.16.0...v0.17.0

    Source code(tar.gz)
    Source code(zip)
  • v0.16.0(Nov 1, 2021)

    Changelog

    Added

    • Added support for header status and no responders to requests (#219)
    • Added support for username and password as part of the url (#216)
    • Added support for client side periodic pings

    Changed

    • Bumped MSRV to 1.52.0

    Removed

    • Use of IntervalTree for client side de-dupe for JetStream consumers
    • Serialized used of test servers, tests can now run in parallel

    Improved

    • Better handling of write errors and server disconnects as part of client side ping support
    • Better handling of message headers

    Complete Changes

    https://github.com/nats-io/nats.rs/compare/v0.15.2...v0.16.0

    Source code(tar.gz)
    Source code(zip)
  • 0.15.2(Sep 15, 2021)

  • 0.15.0(Sep 1, 2021)

    Breaking Changes

    • #207 Support ADR-15-style JetStream reply subject parsing, with several new fields added to the JetstreamMessageInfo struct that can be parsed from a message.
    Source code(tar.gz)
    Source code(zip)
  • 0.14.0(Sep 1, 2021)

  • 0.13.1(Sep 1, 2021)

    New Features

    • #199 implemented asynk::Subscription::try_next.
    • #199 implemented conversion traits b/w sync & async Message types.
    • #205 Options::tls_client_config allows users to provide a manually-configured rustls::ClientConfig for communicating to the server, for cases where certificates are not available on the filesystem.
    Source code(tar.gz)
    Source code(zip)
  • 0.13.0(Aug 11, 2021)

    Improvements

    • #197 JetStream configuration objects now implement PartialEq and Eq.

    Breaking Changes

    • #197 Some JetStream configuration objects have been simplified while more closely matching the Golang JS client semantics.
    Source code(tar.gz)
    Source code(zip)
  • 0.12.1(Aug 11, 2021)

Owner
NATS - The Cloud Native Messaging System
NATS is a simple, secure and performant communications system for digital systems, services and devices.
NATS - The Cloud Native Messaging System
chain nats.io servers with transformation & processing pipelines

NATS proxy service Simple tool to forward specific topics from one nats.io cluster to the same server or another. Provides support to process messages

Marquitos 8 Sep 19, 2022
A library-first, lightweight, high-performance, cloud-native supported API gateway🪐 by RUST

Preview version, will not guarantee the stability of the API! Do NOT use in production environment! A library-first, lightweight, high-performance, cl

Ideal World 4 May 7, 2023
Cloud Native high performance security and privacy SQL proxy.

Fern proxy With the advent of Cloud Native applications, architecture patterns evolved and emerged to take advantage of cloud computing, and build mor

Fern 12 Nov 7, 2022
An end-to-end encrypted, anonymous IP-hiding, decentralized, audio/video/file sharing/offline messaging multi-device platform built for both communications and application security and performance.

An end-to-end encrypted, anonymous IP-hiding, decentralized, audio/video/file sharing/offline messaging multi-device platform built for both communications and application security and performance.

null 2 Apr 27, 2022
A rust client and structures to interact with the Clever-Cloud API.

Clever-Cloud Software Development Kit - Rust edition This crate provides structures and client to interact with the Clever-Cloud API. Status This crat

Clever Cloud 6 Jun 3, 2022
Filen.io is a cloud storage provider with an open-source desktop client.

Library to call Filen.io API from Rust Filen.io is a cloud storage provider with an open-source desktop client. My goal is to write a library which ca

Konstantin Zakharov 5 Nov 15, 2022
A CLI test program for HNU Cloud Computing Lab 2, built with Rust.

HTTP Server Tester This is a CLI test program for HNU Cloud Computing Lab 2. Install For most student, you don't neet to rebuild this project. We prov

null 5 Apr 21, 2022
A wrapper for the Google Cloud DNS API

cloud-dns is a crate providing a client to interact with Google Cloud DNS v1

Embark 5 May 24, 2022
📊 Collect cloud usage data, so that it can be combined with impact data of Boavizta API.

cloud-scanner Collect aws cloud usage data, so that it can be combined with impact data of Boavizta API. ⚠ Very early Work in progress ! At the moment

Boavizta 10 Dec 7, 2022
A SOAP client for Brazilian Central Bank's Time Series Management System

A SOAP client for Brazilian Central Bank's Time Series Management System

Felipe Noronha 3 May 4, 2022
Acts as an IRC server and a nostr client. Connect with your IRC client using your nostr private key as the password.

nostr-irc Acts as an IRC server and a nostr client. Connect with your IRC client using your nostr private key as the password. Experimental code, use

null 11 Dec 26, 2022
Rust-native IPC broker

elbus - Rust-native IPC broker Note: the project is under development and in alpha stage https://elbus.bma.ai/ What is elbus elbus is a rust-native IP

Altertech 66 Dec 31, 2022
Rust port of ffmpeg's native AAC encoder

raash ?? An attempt at RIIR-ing the native AAC encoder from ffmpeg. First, I used c2rust to translate all relevant C code into Rust, and I'm in the pr

Yotam Ofek 6 Dec 1, 2023
Minimal DNS server built in Rust with rule system and logging.

MinDNS MinDNS is a minimal DNS server written in Rust. It is intended to be used as a firewall, black-hole or proxy DNS server. ⚡ Features Fully async

Sammwy 142 Oct 23, 2023
A private network system that uses WireGuard under the hood.

innernet A private network system that uses WireGuard under the hood. See the announcement blog post for a longer-winded explanation. innernet is simi

Tonari, Inc 4.1k Dec 29, 2022
A cross-platform, user-space WireGuard port-forwarder that requires no system network configurations.

Cross-platform, user-space WireGuard port-forwarder that requires no system network configurations.

Aram Peres 629 Jan 4, 2023
Implementation of algorithms for Domain Name System (DNS) Cookies construction

DNS Cookie RFC7873 left the construction of Server Cookies to the discretion of the DNS Server (implementer) which has resulted in a gallimaufry of di

Rushmore Mushambi 2 Feb 4, 2022
Prototype for Koru, a parametrized p2p monetary system.Checkout

Koru About This is a prototype for Koru, a parametrized p2p monetary system consisting of: Mutual credit Voting and decision making platform (for econ

Koru 6 Oct 9, 2022
A tcp port forwarding system like ngrok.

Pruxy A tcp port forwarding system like ngrok. Todo http request handler agent <-> server connection agent How to use Generate cert files mkdir ssl_ce

null 1 Jan 24, 2022