v1.7.0
What's Changed
-
[CHANGE] [CORE] previous versions of the nats javascript clients closed a connection when a permissions error was received by the client. This change instead simply ends the subscription to match other client implementations. For subscriptions that use callbacks, the error will be reported in the error argument, for iterators will throw an error. As before, the connection
status()
will report the same error by @aricart in #267 -
[FEAT] [CORE] Added the ability for the client to report the number of millis in a roundtrip to the server
nc#rtt(): Promise<number>
by @aricart in #307 -
[FEAT] [CORE] it is now possible to specify a
usernamePasswordAuthenticator()
ortokenAuthenticator()
instead of theuser
/pass
andtoken
connect options by @aricart in #287 -
[FEAT] [CORE] Permission errors are now exposed to request API uses, for example, if the request subject has a pub permission issue, the request will fail with the permission error. Similarly, if the problem is with the subscription handling the inbox for the request, the request will fail with the permission error - previously these requests failed with a timeout by @aricart in #296
-
[FIX] [CORE] several unhandled promises on
transport.send()
raised exceptions elsewhere in the library which could crash the client. The transport send errors are typically ignored except during connect, as the client handles connection failures on the read side of the socket by @aricart in #289 -
[FIX] [CORE]
conn.closed()
resolved error not always reported the actual error that triggered the close by @aricart in #294 and #290 -
[FIX] [CORE] Requests that used
noMux
ignored any specified headers by @Kjir in #306
JetStream Changes
-
[FEAT] [JS] [Experimental] JSMsg.next() - pull subscription use only! - combines a pull for the next message (or batch) and
ack()
in one call. Note that this functionality is experimental and not well behaved with iterators by @aricart in #282 and #284. -
[FEAT] [JS] updated StreamInfo to report
alternates
-alternates
are mirrors to the specified stream ordered by latency with respect to the client searching for the stream. This feature allows for tools to learn about other mirrors to the stream and select a different one if desired by @aricart in #291 -
[FEAT] [JS]
jsm.streams.info()
can now provide a request option forsubjects_filter
, which triggers the stream info to report the actual subjects stored in the stream (up to some 10K subject limit) - ADR issue 91 by @aricart in #293 -
[FEAT] [JS] The library now checks for
push_bound
consumer value. When set by the server, this signals that there's already a subscription supporting the push consumer. In cases where the consumer is not part of adeliver_group
and this is set, the subscription will reject, this signals an API usage error, since multiple push subscriptions on a consumer requires the consumer to have adeliver_group
set @aricart in #298 -
[FEAT] [JS] [nats-server 2.7.2 or greater] added support for
ConsumerConfiguration
backoff
-backoff
is a list of retry intervals when the server will re-send messages that are outstanding (not ack'ed) - Note that when specifyingbackoff
themax_deliver
option must be greater than thebackoff
list. The list is inNanos
, so usenanos(millis)
to convert @aricart in #300 -
[FIX] [JS] some JS status errors were processed prematurely by the core NATS request functionality @aricart in #288
-
[FIX] [JS] when specifying
bind
, if the consumer didn't specifydeliver_to
was identified as pull consumer @aricart in #269 -
[DOC] [JS] better pull example that allows seeing redeliveries @aricart in #277
-
[FEAT] [JS] updated
jsm#getAccountInfo()
to report tiered usage and limits. Tiered limits report R1 (no replication) and R3 (R3 replication) JetStream limit values assigned to an account by @aricart in #307
JetStream KV Changes
-
[CHANGE] [KV] will now use
DiscardPolicy.New
when creating KVs on nats-servers 2.7.2 or better @aricart in #262 and @aricart in #270 -
[FEAT] [KV] watch now takes an optional callback that gets called once existing values have been seen - the watch will continue to run notifying of other changes @aricart in #262, @aricart in #264
-
[FEAT] [JS] Allow chaining
ConsumerOptions
builder by @avin-kavish in #283 -
[FEAT] [KV]
jsclient.views.kv()
can now specify abindOnly
option which forces the KV to bind to the specify stream or fail by @Jarema in #276 -
[FIX] [KV] fixed a bug in
history()
which could terminate the iterator before client code got a chance to process the notification by @aricart in #281 -
[FEAT] [KV] adds the ability to request a specific revision (sequence) for a key - note the request will reject if the requested revision doesn't resolve to the specified key by @aricart in #302
-
[FEAT] [KV] [EXPERIMENTAL] added (internal for now) ability to
purgeDeletes(millis)
which purges KV from deleted values older than the specified number of millis by @aricart in #304
Other
-
[FIX] [TEST] external test didn't import nkeys correctly by @aricart in #295
-
[CHORE] [TEST] cluster tool required update due to changes on deno for handling signals by @aricart in #285
New Contributors
- @avin-kavish made their first contribution in #283
- @Kjir made their first contribution in #306
Full Changelog: v1.6.1...v1.7.0