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