NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
crates.io
crates.io, #1490 most downloaded on crates.io
A async Rust NATS client
Latest stable
0.52.0
Last release 16 days ago
06 Nov 2026
Release timing varies
gaps range from 9 days to 3 months
Nearly every release is documented
notes for 60 of the last 60 stable releases
1 version withdrawn
withdrawn after publishing
6 years old
73 releases · first in 2020
Drag across the ruler to compare, or tap a release to open it.
This release fixes panics on line breaks in header values. A \r inside a received header value panicked the connection task, so any client allowed to
This release fixes panics on line breaks in header values. A \r inside a received header value panicked the connection task, so any client allowed to publish on a subject could stop its subscribers' connections. Upgrading is recommended.
It is a minor release because HeaderValue no longer implements From<&str> and From<String>.
HeaderValue no longer implements From<&str> and From<String>. It implements TryFrom<&str>, TryFrom<&String> and TryFrom<String> instead, returning ParseHeaderValueError for a value with \r or \n (#1673). Affected code fails to compile:
headers.insert(k, HeaderValue::from(s)) → headers.insert(k, s)HeaderValue::from(s), s.into() → HeaderValue::try_from(s)? to reject line breaks, HeaderValue::from_lossy(s) to replace themT: Into<HeaderValue> → T: IntoHeaderValuelet Ok(v) = HeaderValue::try_from(s) → handle ParseHeaderValueError, the error is no longer InfallibleString and integer values passed straight to insert or append, and str::parse, keep working.
\r or \n gets a space in place of each instead of panicking. This covers HeaderMap::insert and append, PublishMessage::header, message_id and expected_*, service respond(Err(..)) and received messages. To reject such a value, convert it with HeaderValue::try_from first (#1673).Stream::get_raw_message, get_last_raw_message_by_subject and KV entry without direct get no longer fail on such a header value; they replace the line breaks the same way (#1673).Full Changelog: https://github.com/nats-io/nats.rs/compare/async-nats/v0.51.0...async-nats/v0.52.0
Your coding agent can read these notes before it upgrades. Set up the MCP server →
This release fixes panics on line breaks in header values. A \r inside a received header value panicked the connection task, so any client allowed to publish on a subject could stop its subscribers' connections. Upgrading is recommended.
It is a minor release because HeaderValue no longer implements From<&str> and From<String>.
HeaderValue no longer implements From<&str> and From<String>. It implements TryFrom<&str>, TryFrom<&String> and TryFrom<String> instead, returning ParseHeaderValueError for a value with \r or \n (#1673). Affected code fails to compile:
headers.insert(k, HeaderValue::from(s)) → headers.insert(k, s)HeaderValue::from(s), s.into() → HeaderValue::try_from(s)? to reject line breaks, HeaderValue::from_lossy(s) to replace themT: Into<HeaderValue> → T: IntoHeaderValuelet Ok(v) = HeaderValue::try_from(s) → handle ParseHeaderValueError, the error is no longer InfallibleString and integer values passed straight to insert or append, and str::parse, keep working.
\r or \n gets a space in place of each instead of panicking. This covers HeaderMap::insert and append, PublishMessage::header, message_id and expected_*, service respond(Err(..)) and received messages. To reject such a value, convert it with HeaderValue::try_from first (#1673).Stream::get_raw_message, get_last_raw_message_by_subject and KV entry without direct get no longer fail on such a header value; they replace the line breaks the same way (#1673).Full Changelog: async-nats/v0.51.0...async-nats/v0.52.0
This release adds pinned client support for pull consumers and fixes a number of panics and hangs across JetStream, KV, Object Store and Service APIs.
This release adds pinned client support for pull consumers and fixes a number of panics and hangs across JetStream, KV, Object Store and Service APIs. JetStream API requests are now bounded by the JetStream context timeout when it is set.
It is a minor release because it adds variants to error kind enums, adds public fields to consumer types and raises the MSRV to 1.89.
fips this moves the bundled AWS-LC-FIPS module from 3.x to 4.x.MessagesErrorKind::RequestLimitExceeded and OrderedErrorKind::RequestLimitExceeded (#1631), BatchErrorKind::PinnedClient (#1652). Exhaustive matches on these enums need a new arm.server_2_11: priority_timeout on consumer::Config and pull::Config, priority_groups on consumer::Info (#1653). Struct literals without ..Default::default() need updating (Info has no Default).ConnectError sources are now tokio-websockets 0.13 types, so downcasts to the 0.10 type stop matching (#1656).ContextBuilder::timeout, Context::set_timeout) is set, it is now the only bound for every JetStream API request, whether it is lower or higher than the connection request_timeout. When it is not set, API requests keep using request_timeout (#1636).fetch(), batch() and sequence() return BatchErrorKind::PinnedClient on a PriorityPolicy::PinnedClient consumer. Use stream() or messages() instead (#1652).409 Exceeded MaxRequest* now ends with MessagesErrorKind::RequestLimitExceeded instead of re-pulling forever. Batch and expiry defaults the user did not set are capped at the consumer's limits, and OrderedConfig::max_batch now reaches the server (#1631).{name}_{n}, using the configured name or the name the server gave the first consumer. The previous consumer is now deleted on recreation, unnamed ones included (#1626).ObjectStore::info(), and so put(), uses direct get when the stream allows it, so lookups of missing objects no longer count as JetStream API errors (#1632).ws:// and wss:// on the default port, the Host header no longer includes the port. webpki-roots is no longer a dependency (#1656).Full Changelog: https://github.com/nats-io/nats.rs/compare/async-nats/v0.50.0...async-nats/v0.51.0
This release adds pinned client support for pull consumers and fixes a number of panics and hangs across JetStream, KV, Object Store and Service APIs.
JetStream API requests are now bounded by the JetStream context timeout when it is set.
It is a minor release because it adds variants to error kind enums, adds public fields to consumer types and raises the MSRV to 1.89.
fips this moves the bundled AWS-LC-FIPS module from 3.x to 4.x.MessagesErrorKind::RequestLimitExceeded and OrderedErrorKind::RequestLimitExceeded (#1631), BatchErrorKind::PinnedClient (#1652). Exhaustive matches on these enums need a new arm.server_2_11: priority_timeout on consumer::Config and pull::Config, priority_groups on consumer::Info (#1653). Struct literals without ..Default::default() need updating (Info has no Default).ConnectError sources are now tokio-websockets 0.13 types, so downcasts to the 0.10 type stop matching (#1656).ContextBuilder::timeout, Context::set_timeout) is set, it is now the only bound for every JetStream API request, whether it is lower or higher than the connection request_timeout. When it is not set, API requests keep using request_timeout (#1636).fetch(), batch() and sequence() return BatchErrorKind::PinnedClient on a PriorityPolicy::PinnedClient consumer. Use stream() or messages() instead (#1652).409 Exceeded MaxRequest* now ends with MessagesErrorKind::RequestLimitExceeded instead of re-pulling forever. Batch and expiry defaults the user did not set are capped at the consumer's limits, and OrderedConfig::max_batch now reaches the server (#1631).{name}_{n}, using the configured name or the name the server gave the first consumer. The previous consumer is now deleted on recreation, unnamed ones included (#1626).ObjectStore::info(), and so put(), uses direct get when the stream allows it, so lookups of missing objects no longer count as JetStream API errors (#1632).ws:// and wss:// on the default port, the Host header no longer includes the port. webpki-roots is no longer a dependency (#1656).Full Changelog: async-nats/v0.50.0...async-nats/v0.51.0
This release allows for on-demand swap between chrono and time crates.
This release allows for on-demand swap between chrono and time crates.
Enabling chrono anywhere in the
dependency graph selects the chrono backend for the whole build (Cargo feature unification).
Full Changelog: https://github.com/nats-io/nats.rs/compare/async-nats/v0.49.1...async-nats/v0.50.0
Release focusing on fixing behaviour around server connectivity.
Release focusing on fixing behaviour around server connectivity.
Full Changelog: https://github.com/nats-io/nats.rs/compare/async-nats/v0.49.0...async-nats/v0.49.1
This is a small release adding missing client-side max-payload validations for some methods. It is a minor release as it adds new error kind variants
This is a small release adding missing client-side max-payload validations for some methods. It is a minor release as it adds new error kind variants for relevant calls.
Full Changelog: https://github.com/nats-io/nats.rs/compare/async-nats/v0.48.0...async-nats/v0.49.0
This release focuses on 2.14 nats-server features support.
This release focuses on 2.14 nats-server features support.
try_server_info and max_payload methods by @yordis in https://github.com/nats-io/nats.rs/pull/1567Full Changelog: https://github.com/nats-io/nats.rs/compare/async-nats/v0.47.0...async-nats/v0.48.0
This release adds subject validation (with opt-out possibility) and wraps while connect attempt in timeout, making it more robust.
This release adds subject validation (with opt-out possibility) and wraps while connect attempt in timeout, making it more robust.
once_cell and use std::sync::LazyLock instead by @Jarema in https://github.com/nats-io/nats.rs/pull/1534Full Changelog: https://github.com/nats-io/nats.rs/compare/async-nats/v0.46.0...async-nats/v0.47.0
This release introduces disabled by default feature-gating of features and modules. Users can now disable nkeys, object-store, or others, to limit the
This release introduces disabled by default feature-gating of features and modules.
Users can now disable nkeys, object-store, or others, to limit the size of the final binary and dependency pulled in.
async-nats by @vkolomeyko in https://github.com/nats-io/nats.rs/pull/1489ServiceBuilder::start by @vkolomeyko in https://github.com/nats-io/nats.rs/pull/1486async-nats/src/service/mod.rs by @vkolomeyko in https://github.com/nats-io/nats.rs/pull/1487omitempty case by @Jarema in https://github.com/nats-io/nats.rs/pull/1493drain docs for better clarity by @Jarema in https://github.com/nats-io/nats.rs/pull/1484Full Changelog: https://github.com/nats-io/nats.rs/compare/async-nats/v0.45.0...async-nats/v0.46.0
A smaller release adding missing value field to pub_ack and some additional fixes.
A smaller release adding missing value field to pub_ack and some additional fixes.
value field by @Jarema in https://github.com/nats-io/nats.rs/pull/1473double_ack_with method to JetStream Messages by @OtaK in https://github.com/nats-io/nats.rs/pull/1474Full Changelog: https://github.com/nats-io/nats.rs/compare/async-nats/v0.44.2...async-nats/v0.45.0
This PR adds a new method to Context traits and fixes the docs build
This PR adds a new method to Context traits and fixes the docs build
Full Changelog: https://github.com/nats-io/nats.rs/compare/async-nats/v0.44.1...async-nats/v0.44.2
Add missing errors types by @Jarema in https://github.com/nats-io/nats.rs/pull/1464
Full Changelog: https://github.com/nats-io/nats.rs/compare/async-nats/v0.44.0...async-nats/v0.44.1
A release that focuses on reorganization of types and improvement of extension traits for orbit
A release that focuses on reorganization of types and improvement of extension traits for orbit
message types by @Jarema in https://github.com/nats-io/nats.rs/pull/1462Full Changelog: https://github.com/nats-io/nats.rs/compare/async-nats/v0.43.1...async-nats/v0.44.0
A release that focuses on reorganization of types and improvement of extension traits for orbit
message types by @Jarema in #1462Full Changelog: async-nats/v0.43.1...async-nats/v0.44.0
A hotfix for a regression that was introduced with direct get builder that affected also KV.
A hotfix for a regression that was introduced with direct get builder that affected also KV.
Full Changelog: https://github.com/nats-io/nats.rs/compare/async-nats/v0.43.0...async-nats/v0.43.1
A hotfix for bugs and regressions introduced with recent release.
Full Changelog: https://github.com/nats-io/nats.rs/compare/async-nats/v0.43.0...async-nats/v0.43.13.0
This release adds support for 2.12 server features and adds JetStream backpressure control to publishing.
allow_atomic_publish by @Jarema in https://github.com/nats-io/nats.rs/pull/1448ClusterInfo by @Jarema in https://github.com/nats-io/nats.rs/pull/1439Full Changelog: https://github.com/nats-io/nats.rs/compare/async-nats/v0.42.0...async-nats/v0.43.0
This release adds support for 2.12 server features and adds JetStream backpressure control to publishing.
This release adds support for 2.12 server features and adds JetStream backpressure control to publishing.
The Client abstractions and utilities for easier usage of 2.12 features (counters API, atomic pulish API) will be released soon in orbit.rs
allow_atomic_publish by @Jarema in https://github.com/nats-io/nats.rs/pull/1448ClusterInfo by @Jarema in https://github.com/nats-io/nats.rs/pull/1439Full Changelog: https://github.com/nats-io/nats.rs/compare/async-nats/v0.42.0...async-nats/v0.43.0
This releases focuses on some fixes and addition of Client traits that allow for easier extension of the client.
This releases focuses on some fixes and addition of Client traits that allow for easier extension of the client.
Full Changelog: https://github.com/nats-io/nats.rs/compare/async-nats/v0.41.0...async-nats/v0.41.1
This release focuses on adding limit markers support to KV.
This release focuses on adding limit markers support to KV.
Full Changelog: https://github.com/nats-io/nats.rs/compare/async-nats/v0.40.0...async-nats/v0.41.0
This release focuses on adding support for nats-server v2.11.
This release focuses on adding support for nats-server v2.11.
seen_current instead by @Jarema in https://github.com/nats-io/nats.rs/pull/1377Url::port_or_known_default by @steveej in https://github.com/nats-io/nats.rs/pull/1383Full Changelog: https://github.com/nats-io/nats.rs/compare/async-nats/v0.39.0...async-nats/v0.40.0
This release focuses on improvements and fixes for Object Store and KV. It also removes Service API from experiment feature list, as it is not experim
This release focuses on improvements and fixes for Object Store and KV.
It also removes Service API from experiment feature list, as it is not experimental for quite some time.
sample_freq values containing a % by @bengsparks in https://github.com/nats-io/nats.rs/pull/1354sample_freq de/serialisation test by @bengsparks in https://github.com/nats-io/nats.rs/pull/1356ObjectStore::put by @thinety in https://github.com/nats-io/nats.rs/pull/1366jetstream::Error's Display message by @thinety in https://github.com/nats-io/nats.rs/pull/1365Full Changelog: https://github.com/nats-io/nats.rs/compare/async-nats/v0.38.0...async-nats/v0.39.0
This release adds Websockets support, using tokio-websocket implementation. Feature is behind a feature flag websockets, enabled by default.
This release adds Websockets support, using tokio-websocket implementation.
Feature is behind a feature flag websockets, enabled by default.
Vec<u8> by @mnordstr in https://github.com/nats-io/nats.rs/pull/1337Full Changelog: https://github.com/nats-io/nats.rs/compare/async-nats/v0.37.0...async-nats/v0.38.0
Thank you for all your contributions!
A smaller release containing stats and Watcher improvements.
A smaller release containing stats and Watcher improvements.
Full Changelog: https://github.com/nats-io/nats.rs/compare/async-nats/v0.36.0...async-nats/v0.37.0
This release adds a useful futures::Sink , and ability to get Stream handle without IO call, among other changes.
This release adds a useful futures::Sink<PublishMessage>, and ability to get Stream handle without IO call,
among other changes.
This release introduces StramMessage, which makes both get_raw_message and direct_get methods return the same type, allowing
for more easier interop between two.
StreamMessage by @Jarema in https://github.com/nats-io/nats.rs/pull/1292seen_current to kv by @Jarema in https://github.com/nats-io/nats.rs/pull/1304futures::Sink<PublishMessage> on async_nats::Client by @rvolosatovs in https://github.com/nats-io/nats.rs/pull/1267subscription_capacity documention default value by @nazar-pc in https://github.com/nats-io/nats.rs/pull/1277sample_frequency correctly for Push and Pull Consumers by @bengsparks in https://github.com/nats-io/nats.rs/pull/1300Thank you for all your contributions! 🎉
Full Changelog: https://github.com/nats-io/nats.rs/compare/async-nats/v0.35.1...async-nats/v0.36.0
This release fixes broken docs build caused by fips, which cannot be built in restricted docs.rs environment.
This release fixes broken docs build caused by fips, which cannot be built in restricted docs.rs environment.
Full Changelog: https://github.com/nats-io/nats.rs/compare/async-nats/v0.35.0...async-nats/v0.35.1
This release makes tls setup more flexible, leveraging rusls v0.23 and allowing to pick crypto backend:
This release makes tls setup more flexible, leveraging rusls v0.23 and allowing to pick crypto backend:
Some other highlights:
force_reconnect methodThank you for all your contributions!
ToServerAddrs impl for array/vector of strings by @mmalek in https://github.com/nats-io/nats.rs/pull/1231Arc by @thomastaylor312 in https://github.com/nats-io/nats.rs/pull/1236Full Changelog: https://github.com/nats-io/nats.rs/compare/async-nats/v0.34.0...async-nats/v0.35.0
Breaking changes are minor and should not affect most users, however, all are worth mentioning.
This release introduces performance improvements (thanks to poll_recv_many #1189), improves resilience of ordered consumers by recreating them in more cases while having less server calls. It also adds some new features.
Breaking changes are minor and should not affect most users, however, all are worth mentioning.
This change simplifies lifetimes of Boxed Futures, by making them static. It should not affect most users, and if it does, removal of the lifetime should be a quick fix.
The client was not checking if the message payload size was not exceeding the limits of the server it is connected to.
While doing the fix, the error returned was changed into one consistent with others: a struct with enum of possible
error variants under kind() method, of which one is MaxPayloadExceeded. This should not break users,
as before there was no enum in the first place, but it is a breaking change.
It added new enum variant to Consumer and Stream error kinds. Breaking for those who match those errors in exhaustive manner.
This changes to be a mut self from self while removing unnecessary clone.
create function to kv store by @praveenperera in https://github.com/nats-io/nats.rs/pull/1206into_string method to Subject by @thomastaylor312 in https://github.com/nats-io/nats.rs/pull/1161Events by @paolobarbolini in https://github.com/nats-io/nats.rs/pull/1123ServerAddr::socket_addrs by @paolobarbolini in https://github.com/nats-io/nats.rs/pull/1191Subject::from_static a const fn by @paolobarbolini in https://github.com/nats-io/nats.rs/pull/1207self to a borrow in Request::respond() by @jlandahl in https://github.com/nats-io/nats.rs/pull/1139No Messages by @Jarema in https://github.com/nats-io/nats.rs/pull/1171Thank you for all your high quality contributions! They definately help us push the library into the right direction!
Full Changelog: https://github.com/nats-io/nats.rs/compare/nats/v0.24.1...async-nats/v0.34.0
This release introduces last planned breaking changes and stabilizes the async API.
This release introduces last planned breaking changes and stabilizes the async API.
The biggest change is how subjects are handled. Until now, publish was of type String:
client.publish("subject".to_string(), "data".into()).await?;
This was easy to understand and reason about, but had two downsides:
&'static strThe signature has been change into:
// Signature
async fn publish(subject: impl ToSubject, payload: Bytes)
// Usage
client.publish("subject", "data".into()).await?;
This is not only more concise, but also allows avoiding allocations when subject is static,
or when it is Subject type that can be cheaply cloned leveraging memory optimized bytes::Bytes mechanism under the hood.
Beyond that, there were a lot of improvements to Service API to address cross-language compatibility issues. All structures are now tested against common cross-language json schemas. Thanks @jadamcrain for all the feedback, issues nad PRs related to Service API!
Despite every method having documentation with examples, we were aware that sometimes its hard to navigate the docs to find what someone is looking for. This was addressed by adding module-level docs.
Full Changelog: https://github.com/nats-io/nats.rs/compare/async-nats/v0.32.0...async-nats/v0.33.0
This is a patch release for the new 0.32.0 muxer, as it could subscribe to more messages than necessary, properly dispatching them but potentially inc
This is a patch release for the new 0.32.0 muxer, as it could subscribe to more messages than necessary, properly dispatching them but potentially increasing traffic.
Full Changelog: https://github.com/nats-io/nats.rs/compare/async-nats/v0.32.0...async-nats/v0.32.1
Fix rustls deprecation warning by @paolobarbolini in https://github.com/nats-io/nats.rs/pull/1074
This release primarily focuses on two things:
server_2_10 feature by defaultAn important change introduced by a reworked connection handler is that users should not need
to manually flush by calling client.flush().await to reduce latency.
get and get_all semantics to HeaderMap by @n1ghtmare in https://github.com/nats-io/nats.rs/pull/1071Header::append value to IntoHeaderValue by @caspervonb in https://github.com/nats-io/nats.rs/pull/1076fmt::Display for HeaderValue by @caspervonb in https://github.com/nats-io/nats.rs/pull/1086AsRef for HeaderValue by @caspervonb in https://github.com/nats-io/nats.rs/pull/1087From for HeaderValue on integer types by @caspervonb in https://github.com/nats-io/nats.rs/pull/1083ServerOp parsing by @paolobarbolini in https://github.com/nats-io/nats.rs/pull/1052impl AsRef<Path> instead of PathBuf in credentials APIs by @paolobarbolini in https://github.com/nats-io/nats.rs/pull/1012GETting and object's payload by @paolobarbolini in https://github.com/nats-io/nats.rs/pull/1040FromStr for jetstream::kv::Operation by @n1ghtmare in https://github.com/nats-io/nats.rs/pull/1056Duration in a few more places by @paolobarbolini in https://github.com/nats-io/nats.rs/pull/1038error_impls by @nepalez in https://github.com/nats-io/nats.rs/pull/1047.as_ref() by @robjtede in https://github.com/nats-io/nats.rs/pull/1062Full Changelog: https://github.com/nats-io/nats.rs/compare/async-nats/v0.30.1...async-nats/v0.32.0
This release focuses on improvements of heartbeats in JetStream Consumers.
This release focuses on improvements of heartbeats in JetStream Consumers.
Heartbeats are a tool that tells the user if the given consumer is healthy but does not get any messages or if the reason for no message is an actual problem.
However, if the user was not polling the Stream future for the next messages for a long time (because it was slowly processing messages), that could trigger idle heartbeats, as the library could not see the heartbeat messages without messages being polled.
This release fixes it by starting the idle heartbeat timer only after Stream future is polled (which usually means calling messages.next().await).
HeaderName::from_str call by @caspervonb in https://github.com/nats-io/nats.rs/pull/1032Option and accessing inner T by @paolobarbolini in https://github.com/nats-io/nats.rs/pull/1034BatchConfig expiration by @paolobarbolini in https://github.com/nats-io/nats.rs/pull/1037Full Changelog: https://github.com/nats-io/nats.rs/compare/async-nats/v0.30.0...async-nats/v0.30.1
This is a big release that introduces almost all breaking changes and API refinements before 1.0.0. The last two pending breaking items are:
This is a big release that introduces almost all breaking changes and API refinements before 1.0.0. The last two pending breaking items are:
Subject type (still discussed)Bytes for key-value payloads by @caspervonb in https://github.com/nats-io/nats.rs/pull/939&str over String where applicable by @paolobarbolini in https://github.com/nats-io/nats.rs/pull/878stream::Config::duplicate_window to Duration by @n1ghtmare in https://github.com/nats-io/nats.rs/pull/1023jetstream::Message Acker by @Jarema in https://github.com/nats-io/nats.rs/pull/938watch_with_history to KV store by @n1ghtmare in https://github.com/nats-io/nats.rs/pull/902fmt::Display for HeaderName by @caspervonb in https://github.com/nats-io/nats.rs/pull/924Clone for Message by @mgrachev in https://github.com/nats-io/nats.rs/pull/975reconnect_delay_callback to ConnectOptions by @n1ghtmare in https://github.com/nats-io/nats.rs/pull/962Message serialize/deserialize by @thomastaylor312 in https://github.com/nats-io/nats.rs/pull/998object_store::ObjectInfo fields by @n1ghtmare in https://github.com/nats-io/nats.rs/pull/895header::NATS_LAST_STREAM by @caspervonb in https://github.com/nats-io/nats.rs/pull/948Error type work with anyhow by @paolobarbolini in https://github.com/nats-io/nats.rs/pull/1004base64 crate and use it in place of base64-url by @paolobarbolini in https://github.com/nats-io/nats.rs/pull/871client module public by @caspervonb in https://github.com/nats-io/nats.rs/pull/968ClientOp private by @caspervonb in https://github.com/nats-io/nats.rs/pull/954Command private by @caspervonb in https://github.com/nats-io/nats.rs/pull/953HeaderName::from_str by @caspervonb in https://github.com/nats-io/nats.rs/pull/944ClientOp private by @caspervonb in https://github.com/nats-io/nats.rs/pull/954Command private by @caspervonb in https://github.com/nats-io/nats.rs/pull/953HeaderValue::from_str by @caspervonb in https://github.com/nats-io/nats.rs/pull/943HeaderMap::new by @caspervonb in https://github.com/nats-io/nats.rs/pull/981Serialize, Deserialize and default attributes by @n1ghtmare in https://github.com/nats-io/nats.rs/pull/929jetstream module documentation by @n1ghtmare in https://github.com/nats-io/nats.rs/pull/990Thank you for all your contributions! Those make a difference and drive the ecosystem forward!
Full Changelog: https://github.com/nats-io/nats.rs/compare/async-nats/v0.29.0...async-nats/v0.30.0
This release focuses on preparing for the 1.0.0 release.
This release focuses on preparing for the 1.0.0 release.
The main highlight is Core NATS concrete errors. There are also security improvements (@paolobarbolini thanks for your help!) and JetStream API improvements.
New errors returned by Core NATS methods are not boxed anymore.
They themselves are not enums, but follow more flexible approach of std::io::Error and expose kind() method to get the enum.
All enums implement PartialEq for more straightforward assertions.
match client.request("test".into(), "payload".into()).await {
Ok(response) => println!("response: {:?}", response),
Err(err) => match err.kind() {
RequestErrorKind::TimedOut => todo!(),
RequestErrorKind::NoResponders => todo!(),
RequestErrorKind::Other => todo!(),
},
}
batch and fetch pull consumer methods by @Jarema in https://github.com/nats-io/nats.rs/pull/862Stream a ref in Purge by @n1ghtmare in https://github.com/nats-io/nats.rs/pull/877Stream a ref in Purge by @n1ghtmare in https://github.com/nats-io/nats.rs/pull/877MissedTickBehavior::Skip for flush interval by @n1ghtmare in https://github.com/nats-io/nats.rs/pull/880MissedTickBehavior::Delay for ping interval by @n1ghtmare in https://github.com/nats-io/nats.rs/pull/885Once again, thanks @abalmos & @NorbertBodziony for helping out with replicating the issues around fetch. Also big thanks @paolobarbolini for the very detailed report and reproduction for TLS issue and @n1ghtmare for debugging Windows related issues.
Your contributions are invaluable to the NATS ecosystem.
Full Changelog: https://github.com/nats-io/nats.rs/compare/async-nats/v0.28.0...async-nats/v0.29.0
This release prepares the client for the 2.10.0 server release and adds some fixes and improvements.
This release prepares the client for the 2.10.0 server release and adds some fixes and improvements.
To use the new features before the server 2.10.0 release, enable the server_2_10 feature and run it with dev/nightly server builds.
AckKind::NAK enum variant was changedWhat was before:
AckKind::Nak
Now is:
AckKind::Nak(Option<std::time::Duration>)
Which means a standard NAK example
let message = messages.next().await?;
message.ack_kind(AckKind::Nak).await?;
Now should be used like this
let message = messages.next().await?;
message.ack_kind(AckKind::Nak(None)).await?;
or with custom NAK
message.ack_kind(AckKind::Nak(Some(std::time::Duration::from_secs(10))).await?;
OptionThis field is provided only in clustered mode, so it's now properly inline with that.
idle heartbeat error does not terminate the iteratorThis change does not require any action from the users who want to continue using the client
as they do now, but those who would like to try continuing working with consumers,
even if it returned idle heartbeats, now they can.
server-2.10) by @Jarema in https://github.com/nats-io/nats.rs/pull/814server-2.10) by @Jarema in https://github.com/nats-io/nats.rs/pull/837Consumer::stream and Consumer::messages by @Jarema in https://github.com/nats-io/nats.rs/pull/858Thanks to @abalmos & @NorbertBodziony for helping with detailed reports and feedback!
Full Changelog: https://github.com/nats-io/nats.rs/compare/nats/v0.24.0...async-nats/v0.28.0
A patch release focused solely on important fixes
A patch release focused solely on important fixes
Full Changelog: https://github.com/nats-io/nats.rs/compare/async-nats/v0.27.0...async-nats/v0.27.1
The main focus of this release is Service API with support for multiple endpoints.
The main focus of this release is Service API with support for multiple endpoints.
Vec to ToServerAddrs impl and improve docs examples by @Jarema in https://github.com/nats-io/nats.rs/pull/802ignore_discovered_servers connect option by @caspervonb in https://github.com/nats-io/nats.rs/pull/809Full Changelog: https://github.com/nats-io/nats.rs/compare/async-nats/v0.26.0...async-nats/v0.27.0
Deprecate Stream::purge_filter by @caspervonb in https://github.com/nats-io/nats.rs/pull/755
This release introduces improvements around TLS handling which could cause issues with Windows systems, plus some other fixes and improvements.
Stream::purge_filter by @caspervonb in https://github.com/nats-io/nats.rs/pull/755Thank you @ronz-sensible for helping with TLS on Windows!
Full Changelog: https://github.com/nats-io/nats.rs/compare/async-nats/v0.25.1...async-nats/v0.26.0
A hotfix release, changing consumer::Info.cluster to not break serde when cluster is not present (single server mode).
A hotfix release, changing consumer::Info.cluster to not break serde when cluster is not present (single server mode).
Full Changelog: https://github.com/nats-io/nats.rs/compare/async-nats/v0.25.0...async-nats/v0.25.1
This release focuses on service module, which leverages NATS primitives to provide API for creating and running horizontaly scalable microservices.
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.
Full Changelog: https://github.com/nats-io/nats.rs/compare/async-nats/v0.24.0...async-nats/v0.25.0
This a minor release intended to release all changes before the long-awaited changes around concrete errors land.
This a minor release intended to release all changes before the long-awaited changes around concrete errors land.
Full Changelog: https://github.com/nats-io/nats.rs/compare/async-nats/v0.23.0...async-nats/v0.24.0
It also introduces a breaking change, as not all publish() methods did return PublishError, using the generic async_nats::Error instead. This has been…
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.
Full Changelog: https://github.com/nats-io/nats.rs/compare/async-nats/v0.22.1...async-nats/v0.23.0
A patch release, including early feedback to 0.22.0.
A patch release, including early feedback to 0.22.0.
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.
A patch release, including early feedback to 0.22.0.
Unfortunately, last release included a typo in retry_on_initial_release.
This patch fixes it.
We decided to make a normal patch release without yanking as we're pre 1.0.0 verison.
To avoid similar situations in the future, spellecheck lint will be added before next release.
This release introduces a number of changes and two breaking changes:
This release introduces a number of changes and two breaking changes:
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();
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.
Full Changelog: https://github.com/nats-io/nats.rs/compare/async-nats/v0.21.0...async-nats/v0.22.0
This release's highlight is added support for Object Store.
This release's highlight is added support for Object Store.
Full Changelog: https://github.com/nats-io/nats.rs/compare/async-nats/v0.20.0...async-nats/v0.21.0
This release focuses on KV and 2.9 nats-server features.
This release focuses on KV and 2.9 nats-server features.
Full Changelog: https://github.com/nats-io/nats.rs/compare/async-nats/v0.19.0...async-nats/v0.20.0
This release is focused on resilience of the client against network issues.
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.
Thanks to all contributors for helping out, taking part in discussion and detailed issue reports!
Full Changelog: https://github.com/nats-io/nats.rs/compare/async-nats/v0.18.0...async-nats/v0.19.0
This release focuses on fixes and improvements, with addition of ordered Push Consumer for async-nats crate and callback refactor.
This release focuses on fixes and improvements, with addition of ordered Push Consumer for async-nats crate and callback refactor.
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(())
}
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
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
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.
chrono with time due to RUSTSEC-2020-0159 by @ShellWowza in https://github.com/nats-io/nats.rs/pull/309Full Changelog: https://github.com/nats-io/nats.rs/compare/v0.17.0...v0.18.0
This release focuses on two main things:
This release focuses on two main things:
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?;
Stream iterator to Messages by @caspervonb in https://github.com/nats-io/nats.rs/pull/566Full Changelog: https://github.com/nats-io/nats.rs/compare/async-nats/v0.16.0...async-nats/v0.17.0
This release brings a lot of changes and refactors among which the highlights are:
JetStream type by @caspervonb in https://github.com/nats-io/nats.rs/pull/247ConsumerInfo by @caspervonb in https://github.com/nats-io/nats.rs/pull/252PubAck by @caspervonb in https://github.com/nats-io/nats.rs/pull/243error_callback by @derekcollison in https://github.com/nats-io/nats.rs/pull/253get_message to JetStream context by @caspervonb in https://github.com/nats-io/nats.rs/pull/267get_last_message to JetStream context by @caspervonb in https://github.com/nats-io/nats.rs/pull/267retry_on_failed_connect by @pozsgaic in https://github.com/nats-io/nats.rs/pull/223Headers::try_from by @caspervonb in https://github.com/nats-io/nats.rs/pull/238sealed field to jetstream::StreamConfig by @caspervonb in https://github.com/nats-io/nats.rs/pull/256Full Changelog: https://github.com/nats-io/nats.rs/compare/v0.16.0...v0.17.0
This release features a lot of improvements and additions to JetStream API and adds Push Consumer.
This release features a lot of improvements and additions to JetStream API and adds Push Consumer.
query_account to jetstream::Context by @caspervonb in https://github.com/nats-io/nats.rs/pull/528jetstream::Stream::get_raw_message by @caspervonb in https://github.com/nats-io/nats.rs/pull/484create_consumer to return Consumer by @Jarema in https://github.com/nats-io/nats.rs/pull/544jetstream::consumer::pull::Consumer::stream method. by @Jarema in https://github.com/nats-io/nats.rs/pull/529deliver_subject required for push::Config by @caspervonb in https://github.com/nats-io/nats.rs/pull/531Client into its own source file by @caspervonb in https://github.com/nats-io/nats.rs/pull/523jetstream::Message into its own module by @caspervonb in https://github.com/nats-io/nats.rs/pull/534This is a minor release for the nats client with one fix and several documentation improvements.
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
https://github.com/nats-io/nats.rs/compare/v0.15.2...v0.16.0
This release is the first JetStream 🍾 feature set for async-nats!
This release is the first JetStream 🍾 feature set for async-nats!
It includes:
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::jetstream::Context::publish by @caspervonb in https://github.com/nats-io/nats.rs/pull/460Response::Error variant by @caspervonb in https://github.com/nats-io/nats.rs/pull/496StatusCode type to represent statuses by @caspervonb in https://github.com/nats-io/nats.rs/pull/474async_nats::jetstream::Context::publish_with_headers by @caspervonb in https://github.com/nats-io/nats.rs/pull/462From<jetstream::Message> for Message by @caspervonb in https://github.com/nats-io/nats.rs/pull/512Thanks 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
JetstreamMessageInfo struct that can be
parsed from a message.## Breaking Changes - #211 jetstream::ConsumerConfig.ack_wait and jetstream::PubOpts.ttl have been changed from isize to i64.
jetstream::ConsumerConfig.ack_wait and
jetstream::PubOpts.ttl have been changed from
isize to i64.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.
Client doesn't need to be mutable self by @stevelr in https://github.com/nats-io/nats.rs/pull/434Thanks, @stevelr for your contributions!
Full Changelog: https://github.com/nats-io/nats.rs/compare/nats/v0.13.0...async-nats/v0.14.0
This time around it's just async-nats Client release.
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.
Full Changelog: https://github.com/nats-io/nats.rs/compare/async-nats/v0.12.0...async-nats/v0.13.0
This is a double release. Most work has been done around the async-nats client. nats client got a fix around Key Value.
This is a double release.
Most work has been done around the async-nats client.
nats client got a fix around Key Value.
This release adds a few features accompanied by some architecture overhauls in preparation for JetStream support and good maintainability of the codebase.
Only one fix around this time, as most work is focused around the async client.
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
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
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.
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.
tokio implementationasync-std tokio compact mode working out of the box without performance penaltyOptionsIn the following days, all missing features will be added, and work on Jetstream support will initiate.
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.
0.3.1 by @mfelsche in https://github.com/nats-io/nats.rs/pull/325Features section from Readme.md by @Jarema in https://github.com/nats-io/nats.rs/pull/335Full Changelog: https://github.com/nats-io/nats.rs/compare/v0.18.1...async-nats/v0.11.0
asynk module name.jetstream::IntervalTree type has been made
private in anticipation of built-in FIFO (ordered)
message processing functionality built on top of
different internal structures.Initial release of async NATS client rewrite. 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 async client.
## Improvements - #190 exposed the last connected server's max_payload configurable with the new Connection::max_payload method.
## Improvements - #189 ipv6 address parsing support has been added. ## Breaking Changes - #183 the MSRV bumped to Rust 1.51, which was released on Mar
## Improvements - #183 reset client writer to None upon disconnection
## Improvements - #180 idempotent unsubscription avoids sending multiple UNSUB messages.
## Improvements - #178 client state has been reorganized to allow reading and writing to make progress independently, preventing issues that were some
## Improvements - #177 Add support of request_timeout for async-nats
## New Features - #173 Options::with_static_credentials adds support for static credential files for use in environments where they are injected into
Options::with_static_credentials adds
support for static credential files for use
in environments where they are injected into
the process by means other than an on-disk file.IntervalTree now has the methods min,
max, and gaps for getting the minimum,
maximum, and non-contiguous gaps for the tracked
intervals, for use in situations where users
may want to implement their own deduplication
strategies.## Bug Fixes - #172 fix an issue with a newly future-incompatible usage of the log crate's macros in a match arm.
log crate's macros in a match arm.## Bug Fixes - #170 fix an off-by-one error preventing empty messages with headers from being received.
One column per quarter.