NATS 2.10
Last updated
Was this helpful?
Last updated
Was this helpful?
This guide is tailored for existing NATS users upgrading from NATS version 2.9.x. This will read as a summary with links to specific documentation pages to learn more about the feature or improvement.
Although all existing client versions will work, new client versions will expose additional options used to leverage new features. The minimum client versions that have full 2.10.0 support include:
CLI -
nats.go -
nats.rs -
nats.deno -
nats.js -
nats.ws -
nats.java -
nats.net -
nats.net.v2 - Coming soon!
nats.py - Coming soon!
nats.c - Coming soon!
For critical infrastructure like NATS, zero downtime upgrades are table stakes. Although the best practice for all infrastructure like this is for users to thoroughly test a new release against your specific workloads, inevitably there are cases where an upgrade occurs in production followed by a decision to downgrade. This is never recommended and can cause more harm than good for most infrastructure and data systems.
Below are a few important considerations if downgrading is required.
2.10.0 brings on-disk storage changes which bring significant performance improvements. These are not compatible with previous versions of the NATS Server. If an upgrade is performed to a server with existing stream data on disk, followed by a downgrade, the older version server will not understand the stream data in the new format.
However, being mindful of the possibility of the need to downgrade, a special version of the 2.9.x series was released with awareness of key changes in the new storage format, allowing it to startup properly.
The takeaway is that if a downgrade is the only resort, it must be to 2.9.22 or later to ensure storage format changes are handled appropriately.
There are new stream and consumer configuration options that could be problematic if a downgrade occurs since previous versions of the server have no awareness of them. Examples include:
Multi-filter consumers - Downgrading would result in no filter being applied since the new field is configured as a list rather than a single string.
Subject-transform on streams - Downgrading would result in the subject transform not being applied since the server has no awareness of it.
Compression on streams - Downgrading when compression is enabled on streams will cause those streams to become unloadable since the older server versions will not understand the compression being used.
The requirement to use all wildcard tokens in subject mapping or transforms has been relaxed. This can be applied to config or account-based subject mapping, stream subject transforms, and stream republishing, but not on subject mappings that are associated with stream and service import/export between accounts.
A ts
field has been added to stream info responses indicating the server time of the snapshot. This was added to allow for local time calculations relying on the local clock.
An array of subject-transforms (subject filter + subject transform destination) can be added to a mirror or source configuration (can not use the single subject filter/subject transform destination fields at the same time as the array).
A stream configured with sources
can source from the same stream multiple times when distinct filter+transform options are used, allowing for some messages of a stream to be sourced more than once.
A ts
field has been added to consumer info responses indicating the server time of the snapshot. This was added to allow for local time calculations without relying on the local clock.
A bucket configured as a mirror or sourcing from other buckets
A new header has been added on a fetch response that indicates to clients the fetch has been fulfilled without requiring clients to rely on heartbeats. It avoids some conditions in which the client would issue fetch requests that could go over limits or have more fetch requests pending than required.
Previously, a leafnode configured with two or more remotes binding to the same hub account would be rejected. This restriction has been relaxed since each remote could be binding to a different local account.
k8s/nats -
k8s/nack -
Experimental support for
Experimental support for
A server reload can now be performed by sending a message on by a client authenticated in the system account.
A new has been added to change the default sync interval of stream data when written to disk, including allowing all writes to be flushed immediately. This option is only relevant if you need to modify durability guarantees.
Subject mappings can now be and weighted, enabling the ability to have different mappings or weights on a per cluster basis.
A has been added enabling per-stream subject transforms. This applies to standard streams, mirrors, and sourced streams.
A has been added to stream configuration enabling arbitrary user-defined key-value data. This is to supplant or augment the description
field.
A has been added to stream configuration enabling explicitly setting the initial sequence on stream creation.
A has been added to stream configuration enabling on-disk compression for file-based streams.
The ability to edit the on a stream after stream creation was added.
A is now included in republished messages containing the original message's timestamp.
A has been added which enables applying server-side filtering against multiple disjoint subjects, rather than only one.
A has been added to consumer configuration enabling arbitrary user-defined key-value data. This is to supplant or augment the description
field.
A has been added to key-value configuration enabling arbitrary user-defined key-value data. This is to supplant or augment the description
field.
A has been added to object store configuration enabling arbitrary user-defined key-value data. This is to supplant or augment the description
field.
A pluggable server extension, referred to as , has been added. This provides a mechanism for delegating authentication checks against a bring-your-own (BYO) provider and, optionally, dynamically declaring permissions for the authenticated user.
A unique_tag
field has been added to the and HTTP endpoint responses, corresponding to the value of unique_tag
defined in the server config.
A slow_consumer_stats
field has been added to the HTTP endpoint providing a count of slow consumers for clients, routes, gateways, and leafnodes.
A raft=1
query parameter has been added to the HTTP endpoint which adds stream_raft_group
and consumer_raft_groups
fields to the response.
A num_subscriptions
field has been added to the NATS endpoint responses.
A system account responder for has been added which returns info for the server that the client is connected to.
A system account responder for has been added and works even if a profiling port is not enabled in the server configuration.
A user account responder for has been added which allows a connected user to query for the account they are in and permissions they have.
Support for has been added. Check out the new overview.
When defining routes between servers, a handful of optimizations have been introduced including a pool of TCP connections between servers, optional pinning of accounts to connections, and optional compression of traffic. There is quite a bit to dig into, so check out the page for details.
A has been added enabling TLS-first handshakes for leafnode connections.
The has been added to allow changing the default startup for the server of 10 seconds
The now supports a glob expression on the <pid>
argument which would match a subset of all nats-server
instances running on the host.
Prior to 2.10, setting on mirrors would result in an error. On sourcing streams, only messages that were actively between stored matching configured subjects
would be republished. The behavior has been relaxed to allow republishing on mirrors and includes all messages on sourcing streams.
Previously a dot .
in an MQTT topic was not supported, however now it is! Check out the for details.