Skip to content

Releases: nats-io/nats.node

v2.2.0

25 Aug 22:19
950bf8b
Compare
Choose a tag to compare

This release contains a set of changes that are API-breaking for JetStream. Since the JetStream APIs on the JavaScript clients are Preview, only the minor version of the client has been bumped. Because of these changes, you should carefully read the Breaking Changes section to ensure you are not affected.

BREAKING CHANGES

JetStream Push Consumers In Queue Groups

The Push Consumer Queue feature has changed. A new nats-server (2.4.0) has been released that modifies how this feature works.
The new JavaScript clients have been modified to work with the new server and will fail to work with an existing server using push consumers with queue groups.

Previously it was possible to create a push consumer and properly get it working in a queue group with a regular NatsConnection#subscribe or NatsConnection#jetstream()#subscribe() if all queue subscriptions used the same queue name and no plain (non-queue) subscriptions were used.

If the mix of subscriptions and queues referenced the same consumer but provided different queue names or no queue names, the delivery of messages was incorrect and could create conditions where some messages were seen in duplicate or have unexpected side effects.

The new nats-server changes will make an old consumer configuration with a queue group a noop - the server will not send messages to the client. To enable a queue group to work on a consumer:

  • The consumer configuration must specify a deliver_group matching the queue group name.
  • Configurations that use the consumer with a non-matching queue group will be invalid.
  • Configurations that use a queue group consumer without a queue group will be invalid.

The NATS client for JavaScript on 2.2.0 and beyond, enforces the above rules, so an Error is thrown from NatsConnection#jetstream().subscribe() for configurations that try to use the queue group incorrectly.

Because an old server will not report deliver_group for the consumer, any jetstream#subscribe() that attempts to specify a queue group will fail the validation.

If you are creating your own NATS subscription to handle the consumer, and have an old server, you may continue to do that until you upgrade the server, at which point the nats-server will stop delivering messages to your client. Please ensure you don't use the consumer from different queue groups in the meantime.

JetStreamManager#streams#getMessage(number)

This API has been removed (it was deprecated and printing console messages). To retrieve a message by its sequence,
replace with JetStreamManager#streams#getMessage({seq: number}).

JetStream SequencePair was renamed SequenceInfo

This matches changes in the server. These types are referenced from ConsumerInfo.

Other Changes

  • [FIX] #441 - when Istio is booting, it is possible for the socket to close, triggering a catch(err) where the error is undefined - this fix simply aliases that as a connection refused error.

  • [FEAT] Added DeliveryPolicy#LastPerSubject which allows a consumer to get the last message for each subject in a stream.

  • [FEAT] PubAck now reports a domain field representing the JetStream domain if set or returning an empty string. This feature requires a newer server.

  • [FIX] ConsumerConfig now have fields deliver_group, description.

v2.1.0

02 Jul 16:00
9d53eda
Compare
Choose a tag to compare

This release sports a number of updates enhancing the JavaScript JetStream functionality.
For a complete list of changes, see https://github.com/nats-io/nats.deno/releases/tag/v1.1.0.

v2.0.8

24 Jun 14:10
f369e3b
Compare
Choose a tag to compare

v2.0.6

02 Jun 16:14
4989272
Compare
Choose a tag to compare

v2.0.4

10 May 21:47
e50979b
Compare
Choose a tag to compare

v2.0.2

05 Apr 22:58
bd10f4c
Compare
Choose a tag to compare
  • [update] nats-base-client to v1.0.2:
    • [fix] added cluster to possible properties in ServerInfo
    • [change] jetstream max_age - in StreamConfig marked as Nanos
    • [fix] omission of headers in JetStreamPublishOptions

v2.0.1

27 Mar 00:42
0f730ff
Compare
Choose a tag to compare

[update] updated to nats-base-client v1.0.1, this release contains an important fix regarding the munging of reply subjects on messages that were received during different socket reads. This would cause clients to timeout when expecting a response.

v2.0.0

15 Mar 21:14
Compare
Choose a tag to compare

NATS 2.0.0 Release

v1.4.12

07 Aug 17:56
Compare
Choose a tag to compare

[FIX #367] tls.connect callback performed a flushPending which didn't strip subs. (#368)

v1.4.9

29 Apr 20:29
Compare
Choose a tag to compare

Release Notes

  • FIX #340 - If tls was used and the connect timeout option was used, a leaked timer closed the connection.
  • FIX #347 - Fixed an issue where host:port specified in servers were not expanded to NATS urls, failing the dial.
  • FIX #349 - Bumped control line to match default for the server (4K)