Releases: nats-io/nats.rs
Release async-nats/v0.31.0
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
).
What's Changed
- Fix unwrap from
HeaderName::from_str
call by @caspervonb in #1032 - Use idiomatic method for writing
Option
and accessing innerT
by @paolobarbolini in #1034 - Add missing sequence number reset by @paolobarbolini in #1035
- Fix header name range validation by @caspervonb in #1031
- Simplify consumer checking logic by @paolobarbolini in #1033
- Fix millis -> nanos typo in
BatchConfig
expiration
by @paolobarbolini in #1037 - Fix kv purge with prefix (thanks @brooksmtownsend for reporting it!) by @Jarema in #1055
- Remove memcpy in object store PUT by @paolobarbolini in #1039
- Drop subscription on list done by @Jarema in #1041
- Improve push consumer handling when encountering slow consumers by @Jarema in #1044
- Rework idle heartbeat for pull consumers by @Jarema in #1046
- Rework push consumer heartbeats handling by @Jarema in #1048
Full Changelog: async-nats/v0.30.0...async-nats/v0.30.1
Release async-nats/v0.30
0.30.0
Overview
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:
- Improved builders based on #828
- Introduce a
Subject
type (still discussed)
Breaking Changes
- Update Service for parity with ADR by @Jarema in #965
- Remove schema and api_url from Service API by @Jarema in #972
- Add concrete error types to JetStream by @Jarema in #874
- Add concrete errors to KV by @Jarema in #1014
- Add concrete errors to Object Store by @Jarema in #1015
- Add Pull Consumer concrete errors by @Jarema in #1009
- Use
Bytes
for key-value payloads by @caspervonb in #939 - Use u64 instead of usize for nanoseconds by @MJayat in #901
- Prefer returning
&str
over String where applicable by @paolobarbolini in #878 - Change
stream::Config::duplicate_window
toDuration
by @n1ghtmare in #1023
Added
- Add ordered pull consumer by @Jarema in #916
- Add
jetstream::Message
Acker
by @Jarema in #938 - Add Context::get_consumer_from_stream by @Jarema in #502
- Add custom auth callback by @Jarema in #997
- Add custom tls config option by @Jarema in #903
- Add
watch_with_history
to KV store by @n1ghtmare in #902 - Implement AsRef for HeaderName by @matthiasbeyer in #921
- Implement
fmt::Display
forHeaderName
by @caspervonb in #924 - Derive
Clone
forMessage
by @mgrachev in #975 - Add max_bytes for pull consumer config by @piotrpio in #992
- Add inactive threshold for pull consumer by @paulgb in #994
- Add const representation for standard header names by @caspervonb in #946
- Add static representation for custom header names by @caspervonb in #967
- Add
reconnect_delay_callback
toConnectOptions
by @n1ghtmare in #962 - Makes
Message
serialize/deserialize by @thomastaylor312 in #998
Fixed
- Disconnect if pending pings is more than max pings by @caspervonb in #956
- Fix serialization of
object_store::ObjectInfo
fields by @n1ghtmare in #895 - Fix ordered consumer handling for stream sequence and heartbeats by @Jarema in #961
- Canonicalize
header::NATS_LAST_STREAM
by @caspervonb in #948 - Fix KV update so that it works properly with a JS domain by @protochron in #1000
- Fix object store compatibility issue with Go implementation by @tinou98 in #984
- Drop subscription on object read done by @Jarema in #1011
Changed
- Make the current
Error
type work with anyhow by @paolobarbolini in #1004 - Remove collect to Vec in try_read_op by @YaZasnyal in #894
- Remove unnecessary clone for publish payloads by @YaZasnyal in #893
- Remove extra whitespaces by @mgrachev in #904
What's Changed
- Optimize read buffer with capacity to reduce allocations by @YaZasnyal in #888
- Make SubscribeError public by @Jarema in #899
- Remove a few redundant allocations by @paolobarbolini in #876
- Update
base64
crate and use it in place ofbase64-url
by @paolobarbolini in #871 - Make
client
module public by @caspervonb in #968 - Allow multiple auth methods by @n1ghtmare in #937
- Update nkeys to v0.3.0 by @vados-cosmonic in #995
Misc
- Make
ClientOp
private by @caspervonb in #954 - Make
Command
private by @caspervonb in #953 - Disallow non-alphanumeric in
HeaderName::from_str
by @caspervonb in #944 - Improve top level crate documentation by @n1ghtmare in #985
- Make
ClientOp
private by @caspervonb in #954 - Make
Command
private by @caspervonb in #953 - Disallow new lines in
HeaderValue::from_str
by @caspervonb in #943 - Replace manual Error type declarations by @paolobarbolini in #1005
- Document
HeaderMap::new
by @caspervonb in #981 - Reset ping interval on incoming and outgoing messages by @caspervonb in #932
- Remove redundant serde
Serialize
,Deserialize
anddefault
attributes by @n1ghtmare in #929 - Improve top level
jetstream
module documentation by @n1ghtmare in #990 - Improve JetStream KV documentation by @n1ghtmare in #991
- Bump rustls-webpki to v0.101.1 by @paolobarbolini in #1013
Thank you for all your contributions!
Those make a difference and drive the ecosystem forward!
New Contributors
- @YaZasnyal made their first contribution in #894
- @MJayat made their first contribution in #901
- @matthiasbeyer made their first contribution in #921
- @tinou98 made their first contribution in #984
- @vados-cosmonic made their first contribution in #995
- @protochron made their first contribution in #1000
Full Changelog: async-nats/v0.29.0...async-nats/v0.30.0
Release async-nats/v0.29.0
Overview
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.
Concrete Errors
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.
Example:
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!(),
},
}
Added
- Add support for stream subject transform by @n1ghtmare in #867
- Add retaining server list order option by @Jarema in #890
Fixed
- Fix a typo in the documentation by @marcusirgens in #864
- Fix reconnect burst on auth failure by @Jarema in #890
Changed
- Concrete error types for Core NATS by @Jarema in #632
- Improve TLS connection resilience by @Jarema in #881
- Improve
batch
andfetch
pull consumer methods by @Jarema in #862 - Make
Stream
a ref inPurge
by @n1ghtmare in #877 - Cleanup dependencies by @paolobarbolini in #872
- Make
Stream
a ref inPurge
by @n1ghtmare in #877 - Use
MissedTickBehavior::Skip
for flush interval by @n1ghtmare in #880 - Use
MissedTickBehavior::Delay
for ping interval by @n1ghtmare in #885
New Contributors
- @marcusirgens made their first contribution in #864
- @paolobarbolini made their first contribution in #872
Once 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: async-nats/v0.28.0...async-nats/v0.29.0
Release async-nats/v0.28.0
Overview
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.
Breaking Changes
To enable NAK with backoff, the AckKind::NAK
enum variant was changed
What 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?;
Consumer info cluster field is now Option
This field is provided only in clustered mode, so it's now properly inline with that.
Consumer idle heartbeat
error does not terminate the iterator
This 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.
Added
- Add support for consumers with multiple filters (feature
server-2.10
) by @Jarema in #814 - Add metadata support (feature
server-2.10
) by @Jarema in #837 - Add NAK and backoff support by @Jarema in #839
Fixed
- Fix flapping ack test by @Jarema in #842
- Fix Pull Fetch test by @Jarema in #845
- Update consumer last_seen on status messages and requests by @Jarema in #856
- Improve pull consumer robustness for
Consumer::stream
andConsumer::messages
by @Jarema in #858
Changed
- Make consumer info cluster field optional by @n1ghtmare in #840
- Bump dependencies by @Jarema in #848
- Idle Heartbeats now does not fuse the consumer iterator by @Jarema in #856
Contributions
Thanks to @abalmos & @NorbertBodziony for helping with detailed reports and feedback!
Full Changelog: nats/v0.24.0...async-nats/v0.28.0
Release nats/v0.24.0
Release async-nats/v0.27.1
Overview
A patch release focused solely on important fixes
Fixed
- Fix no error when auth is not provided but required by @Jarema in #822
- Fix flush after reconnecting by @Jarema in #823
- Fix duplicate consumer creation by @thomastaylor312 in #824
Full Changelog: async-nats/v0.27.0...async-nats/v0.27.1
Release async-nats/v0.27.0
Overview
The main focus of this release is Service API with support for multiple endpoints.
Added
- Add multiple endpoints service by @Jarema in #791
- Add
Vec
toToServerAddrs
impl and improve docs examples by @Jarema in #802 - Add
ignore_discovered_servers
connect option by @caspervonb in #809
Changed
- Remove unsafe usages in async-nats by @zaynetro in #813
- Explicitly delete consumer after iterating over kv keys by @Jarema in #818
Fixed
- Fix key listing for async client to match Go client by @thomastaylor312 in #792
New Contributors
- @thomastaylor312 made their first contribution in #792
- @zaynetro made their first contribution in #813
Full Changelog: async-nats/v0.26.0...async-nats/v0.27.0
Release async-nats/v0.26.0
Overview
This release introduces improvements around TLS handling which could cause issues with Windows systems, plus some other fixes and improvements.
Added
- Add streams list by @Jarema in #785
- Add stream names list by @Jarema in #783
- Add type to service responses by @Jarema in #786
- Add kv example by @Jarema in #784
Fixed
- Fix queue push consumer by @Jarema in #793
- Change TLS to conditionally load native certs (reported by @ronz-sensible) by @Jarema in #794
- Setup tls only if required (repored by @ronz-sensible) by @Jarema in #788
Changed
- Deprecate
Stream::purge_filter
by @caspervonb in #755 - Improve defaults for connection by @Jarema in #790
Thank you @ronz-sensible for helping with TLS on Windows!
Full Changelog: async-nats/v0.25.1...async-nats/v0.26.0
Release async-nats/v0.25.1
Overview
A hotfix release, changing consumer::Info.cluster
to not break serde when cluster
is not present (single server mode).
Fixed
Full Changelog: async-nats/v0.25.0...async-nats/v0.25.1
Release async-nats/v0.25.0
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 #748
- Ordered and convenient HeaderValue reported by @cortopy, implemented by @Jarema in #767
Changed
- Always reset periodic flush interval after manual flush by @caspervonb in #747
- Fuse the pull consumer Stream after terminal error by @Jarema in #751
- Remove auth_required comment by @Jarema in #763
- Change JetStream request timeout to 5 seconds by @Jarema in #772
Full Changelog: async-nats/v0.24.0...async-nats/v0.25.0