Releases: nats-io/nats.deno
v1.9.0
What's Changed
-
[FEAT] [JETSTREAM] added support for new consumer creation API by @aricart in #353
-
[FEAT] [JETSTREAM]
StreamConfig
now hasmirror_direct
option by @aricart in #355 -
[FEAT] [JETSTREAM] added support consumer heartbeats (push consumers, and fetch apis only) by @aricart in #327
-
[FIX] [JETSTREAM] Added validation of
name
option inConsumerConfig
by @aricart in #362 -
[FEAT] [JETSTREAM] JSM now provides API to list kvs and objectstores by @aricart in #364
-
[FEAT] [JETSTREAM]
StreamInfo
pagination support for streams that request a list of subjects by @aricart in #365 -
[FIX] [JETSTREAM] paged responses for stream info didn't take into account changing total reported by the server by @aricart in #368
-
[FEAT] [JETSTREAM]
jsm.streams.list()
can now specify a subject filter by @aricart in #369 -
[FIX] [JETSTREAM] added server version checks for kv and objectstore usage by @aricart in #371
-
[FEAT] [JETSTREAM] added support for
discard_new_per_subject
functionality on StreamConfig and KV uses by @aricart in #373 -
[FEAT] [JETSTREAM] Ordered consumer changes by @aricart in #376
-
[FEAT] [JETSTREAM] added JSM API to list stream names by @aricart in #379
-
[FIX] [OBJECTSTORE] getting a deleted entry, resolves to
null
. by @aricart in #351 -
[FIX] [OBJECTSTORE] fixed an issue where an entry's info was not properly generated when the entry had no partial chunks by @aricart in #358
-
[FIX] [OBJECTSTORE] added additional checks to update by @aricart in #363
-
[FIX] [OBJECTSTORE] made
put()
reject link configurations by @aricart in #367 -
[FIX] [OBJECTSTORE] made meta subject compatible across clients by @tothandras in #372
-
[FIX] [OBJECTSTORE] updated sha-digest prefix to match changes in Go client by @tothandras in #382
-
[TEST] [OBJECTSTORE] fix tests referencing old digest prefix by @aricart in #384
-
[CHANGE] [KV] by default kv enables
allow_direct
unless client opts-out. by @aricart in #361 -
[FEAT] [KV] exposed size of the bucket via
KvStatus.size
by @aricart in #378 -
[FEAT] [KV] Added support to access KV mirrors by @aricart in #391
-
[INTERNAL] added support for Feature disablements by @aricart in #366
-
[FIX] [DOC] links in the documentation, missing types by @aricart in #380
-
[FEAT] [CORE] added ability for client to set a status on a header by @aricart in #386
-
[FIX] [CORE] subscription closed, terminated iterators that had pending messages before the client was able to process them by @aricart in #388
-
[FIX] [CORE] added fixes to prevent unhandled rejection of initial PONG promise, ensured that if the client closed due to an error, that the close handler wouldn't attempt to flush the pending buffer as the connection is already gone by @aricart in #390
-
[CI] updated nats-server to 2.9.5, and deno to 1.27.0 by @aricart in #392
-
[TEST] [JETSTREAM] added test verifying that new consumer creation accepts
durable_name
andname
when same, and rejects when different. by @aricart in #360 -
[TEST] [JETSTREAM] fixed cross account test to allow acks to reach the source stream by @aricart in #374
-
[TEST] [OBJECTSTORE] added a test for object store that verifies generated hashes against expected hashes by @aricart in #359
New Contributors
- @tothandras made their first contribution in #372
Full Changelog: v1.8.0...v1.9.0
v1.8.0
What's Changed
-
[CHANGE] [JETSTREAM] StreamUpdateConfig can now update
num_replicas
option by @aricart in #313, #314. -
[CHANGE] [JETSTREAM]
StreamConfig
'splacement
,deny_delete
anddeny_purge
options are now updatable and part ofStreamUpdateConfig
. OptionStreamConfig.template_owner
is removed as option is not supported. by @aricart in #314 -
[FIX] [JETSTREAM]
JetStreamManager.streams.update()
now retrieves the existing stream configuration and applies values specified to the retrieved configuration. This prevents unexpected changes from being set on a stream due to the server reacting to defaulted values in the JSON configuration. by @aricart in #315. -
[FEAT] [JETSTREAM] library now adds support for the "Direct GET Message API" from the server. This API offers increased performance at the risk of retrieving an old value that is in flight for an update (such as adding a message to a stream and then immediately attempting to retrieve it by its subject). This API call can retrieve messages from any stream replicas regardless of the current leader status for the stream. This feature is only available on 3.9.0 servers, and it is intended for KV get applications. by @aricart in #316, #320, #325, #341
-
[FEAT] [JETSTREAM]
StreamUpdateConfig.republish
allows the nats-server to republish messages that are ingested by a stream to a different subject. The message published is a NATS core message. The configuration allows mapping a filter (src
) subject to a destination subject, and whether only headers should be sent. Messages that are republished will have NATS-specific headers (grouped under theRepublishHeaders
enum) that allow the client to identify the stream, subject, sequence, last sequence and size of the message. by @aricart in #333 -
[FEAT] [JETSTREAM] Pull consumers can now specify
max_bytes
as aPullOptions
. This option will limit the number of messages the server returns to fit into the specifiedmax_bytes
option. Note that if the stream contains a message that exceedsmax_bytes
, the consumer will fail, as the request cannot be honored. by @aricart in #318 -
[FIX] [JETSTREAM] when binding to a stream, the consumer didn't capture the
durable_name
orname
in case of ephemerals, which failedinfo()
requests on the pull/push consumer. by @aricart in #330 -
[FEAT] [JETSTREAM]
JetStreamClient.publish()
now has the optionsretries
andretry_delay
. These options configure the client to reattempt publishing a message is rejected with a 503 (JetStream is not available) error. These options are not yet exposed inJetStreamPublishOptions
type, but can be set and will be by @aricart in honored. #334. -
[FEAT] [JETSTREAM]
ConsumerOptsBuilder
can now setmemory()
andnumReplicas(number)
options. These options instruct the nats-server to maintain the consumer's state in memory and/or the number of replicas to use rather than inherit a setting from the stream. by @aricart in #336, #337 -
[FIX] [JETSTREAM]
AccountLimits
now typesmax_ack_pending
by @aricart in #321 -
[FIX] [KV]
KvOptions.placementCluster
was not honored.KvOptions.maxBucketSize
,KvOptions.backingStore
,KvOptions.placementCluster
are now deprecated useKvOptions.max_bytes
,KvOptions.storage
,KvOptions.placement
instead.KvStatus.backingStore
andKvStatus.bucketLocation
are deprecated, useKvStatus.storage
andKvStatus.placement
instead.KvStatus
returned byKv.status()
now reports the storage type and the number of replicas, and ttl is expressed in millis. by @aricart in #314, #340, #350 -
[FEAT] [KV] KV client enables the GET direct message API when the option
allow_direct
is specified or the client connects to a 3.9.0 or better server. by @aricart in #316 -
[FEAT] [KV] KV can now specify a republish configuration in
KvOptions.republish
. by @aricart in #340 -
[FEAT] [ObjectStore] [BETA] A new materialized view,
ObjectStore
is now available underJetStreamClient.views.os
.ObjectStore
allows you to store large assets whose contents are split into multiple chunks in a stream. The API relies on standard JavaScript ReadableStream. This feature makes use ofcrypto.subtle
JavaScript APIs. This API is shimmed on node versions greater than 14. Node 14 will require a user-provided shim to work. The API for this functionality is likely to change. by @aricart in #339. -
[FEAT] [CORE] [EXPERIMENTAL] The client can now perform scatter/gather type requests by using
requestMany(subject: string, data: Uint8Array, opts: {maxWait: 1000, maxMessages: -1}): Promise<QueuedIterator<Msg|Error>
. This request will gather and return multiple responses from a request (whether from a single service responding with multiple messages or responses from multiple services). For more information, check out the tests - note you'll need to cast the client to aNatsConnectionImpl
to expose the functionality under typescript. by @aricart in #326. The API implements multiple strategies, such as:- Wait for a fixed timer to expire before returning results
- Wait for some number of messages to be received or a timer to expire
- Wait for an unknown number of messages to arrive, which stops collecting after 300 milliseconds (not yet configurable) from the last message delivered
- Wait until a message with no payload is received.
-
[FIX] [CORE] Added support for
tls_available
. This server info option is set by the nats-server whenallow_non_tls
is configured in the server, allowing the server to use TLS and plain connections at the same time. By default, the client will attempt to upgrade to TLS if available. To prevent the upgrade from happening, set thetls
connection option tonull
. If not set, the client will attempt an upgrade. If TLS is configured, TLS will be required. by @aricart in #348. Thanks to @reecefenwick for the initial model fix. -
[FIX] Cleaned up the use of the Date API to explicitly call parse rather than parse the string. by @aricart in #343
-
[DOC] Most types and APIs on the client now have proper comments (JSDoc). The documentation is hosted live as https://nats-io.github.io/nats.deno. Note that this documentation is shared between all nats-base-client APIs (nats.js, nats.deno, nats.ws). by @aricart in #333, #346
-
[DOC] Fix the wrong name for a variable by @jonaslagoni in #332
-
[UPDATE] updated dependencies on nkeys.
Deno Specific
- [UPDATE] Updated Deno to 1.24.3 and std 0.152.0.
New Contributors
- @jonaslagoni made their first contribution in #332
Full Changelog: v1.7.1...v1.8.0
v1.7.1
What's Changed
- [CHANGE] internal API change
Transport.send()
to not return a promise - previously any send resulted in a promise, however rejecting of the promise is only interesting in some very specific cases, yet it complexified downstream handling, which in some cases resulted in unhandled promises see #271 by @aricart in #312
Other Changes
- [TEST] added a test to verify that an iterator on a subscription permission error will throw the permissions error by @aricart in #309
- [CHORE] silenced tests that were outputting to stdout (except for test on
debug
connect option) by @aricart in #310 - [FEAT] [EXPERIMENTAL] requestMany() by @aricart in #311
Full Changelog: v1.7.0...v1.7.1
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
v1.6.1
What's Changed
[FIX] StreamUpdateConfig
, StreamConfig
and jsm.streams.update()
signature by @aricart in #258
[FIX] [NODE] Node.js v17.5.0 introduced a change that makes nats.js seems to go in an loop that exceeds the stack - this issue is only on node where we specifically remapped subarray into slice as subarray was copying memory by @aricart in #259
[DOCS] typo in docs by @Jarema in #257
New Contributors
Full Changelog: v1.6.0...v1.6.1
v1.6.0
What's Changed
The following changes affect the "nats-base-client" which is shared by all the supported JavaScript clients:
- [FIX] [JETSTREAM] NATS server 2.7 behavior changes @aricart in #249
- mixing
no_wait
andexpires
on JetStream pull consumers changed. If no messages were available the server honors theexpires
. If a client specifiesno_wait
the JavaScript client will clear out theexpires
. This behaves as previous releases. - server can now return a
408
error when an expires in a pull request triggers. This error was not trapped directly by the pull consumer, so it ended the request with an error, which terminated any iterators with an error, when simply there are no messages, and client should just be re-pulling on it's own timer. - nats server 2.7 now supports ephemeral pull consumers.
- mixing
- [FEAT] [JETSTREAM] new pull consumer and ephemeral consumer options
inactive_threashold
(informs the server the maximum amount of time an inactive ephemeral consumer should be allowed to exist),max_batch
specifies the maximum number of messages that a pull consumer should be able to specify, andmax_expires
the max amount of time that a pull request with anexpires
should be allowed to remain active by @aricart in #251 - [FEAT] [JETSTREAM] add support for
nak()
with a delay - a JetStream message may now benak
and provide an argument for specifying how long the server should back-off before resending the message by @aricart in #253 - [FIX] hostPort parsing relies on built-in
new URL()
for parsing. JavaScript URL only correctly handleshttp/s
protocols. If port80
was specified, the URL parsing code discarded the port (as it matched the protocol), thus activating the logic to set the default port of4222
as added. by @aricart in #254 - [FIX] added constraint to reject
ConnectionOptions
when bothservers
andport
are specified. by @aricart in #255 - [FIX] processing of
ConnectionOptions
processedport
property beforeservers
by @aricart in #248
Full Changelog: v1.5.0...v1.6.0
v1.5.0
What's Changed
Changes to the Deno client
These changes are only specific to the Deno client
- [BREAKING] Deno APIs for handling Tls connections has changed. Deno versions lower than 1.16.x are incompatible. This change effectively sets Deno 1.16.x as the lowest supported version. by @aricart in #232
Changes to NBC library
These changes are shared by all NATS.io supported JavaScript clients.
- [FEAT] JetStream APIs for JavaScript are no longer preview. Note that Materialized views APIs are marked as beta and subject to change. by @aricart in #234
- [FEAT] JetStreamManager API added
consumers.update()
. TheConsumerUpdateConfig
provides some introspection into fields that can be modified. Modifying a consumer is only supported on servers 2.6.4 or better. @aricart in #229 - [CHANGE] JetStreamManager API
streams.update()
now requires the name of the stream. TheStreamUpdateConfig
provides some introspection into fields that can be modified. The previous API is shimmed, however, the shim will be removed on a future release. by @aricart in #230 and #235 - [FIX] Fixed an issue where a fast path for text encoding/decoding of NATS protocol messages (non-payload) didn't handle UTF code-points (ie when using username/password that contained these characters). All encoding decoding of protocol messages now uses TextEncoder/Decoder. by @aricart in #238
- [CHANGE] [BETA] KV
keys()
now returns an iterator rather than a list of keys. If using the beta API you must change your code as no shim is possible by @aricart in #240 - [FIX] Documentation typos. by @MrMYHuang in #244
- [FEAT] added support for custom reviver in JSONCodec by @tommyo in #242
- [FEAT] added support for KV prefix handling by @aricart in #239
New Contributors
- @MrMYHuang made their first contribution in #244
- @tommyo made their first contribution in #242
Full Changelog: v1.4.0...v1.5.0
v1.4.0
What's Changed
- [FEAT] JS consumer
bind
by @aricart in #217 - [FIX]
Auth
is not exported FIX #218 by @aricart in #219 - [FEAT] Allow access to consumer info in watch for internal extenders by @aricart in #220
- [FEAT] Allow access to JetStreamSubscriptionInfoable for downstream internal extenders by @aricart in #221
- [CHANGE] Kv.keys() returns an iterator by @aricart in #224
- [FIX] removed the conditional check on setting KvEntry.delta, as the pending are now properly reported by @aricart in #225
- [FEAT] surface JS errors as per ADR-7 by @aricart in #227
Full Changelog: v1.3.1...v1.4.0
v1.3.1
What's Changed
[FIX] validating a request, which returns a promise, could result in an exception being thrown - because the function isn't async the promise in those environments wasn't (correctly so) rejected, thus failed tests and possibly raised conditions that would require additional try/catch logic than necessary. #216
Full Changelog: v1.3.0...v1.3.1
v1.3.0
What's Changed
- [FIX]
break
from within an iterator now properly closes a subscription #190 - [ENHANCE] some exceptions now include a trace of the API where the call happened - for example timeouts/requests, this helps to understand what timed out or failed #196 and #199
- [FIX] partial frames during a connect's peek of the info block could fail and thus creating other issues downstream related to connection errors #201
- [FEAT] DNS names are now resolved by the client by #202 and #206
JetStream Changes
- [UPDATE] KV materialized views - the KV API is now acccessible under
nc.jetstream().views.kv()
. #213, #214 - [FEAT] Ordered Consumer #215
- [FIX] remove
name
from ConsumerConfig - this property doesn't exist in ConsumerConfig #210 - [FIX] flow control/protocol messages are now handled when they would be dispatched #208
- [FIX] The consumer options now match go client. Also exposed newly added consumer/stream options #211
- [FIX]
redelivered
property on js message was not reporting redeliveries by #200
Some features such as KV purge, require at least 2.6.3 nats-server, and raise errors on older servers.
Full Changelog: v1.2.0...v1.3.0