Skip to content

Release v1.14.0

Compare
Choose a tag to compare
@kozlovic kozlovic released this 08 Apr 20:27
· 456 commits to main since this release
1714729

Changelog

JetStream and KeyValue users

Please see the "Changed" section for important (possibly breaking) changes compared to the previous version.

Experimental

The ObjectStore is still experimental and subject to change.

Added

  • JetStream:
    • Support for tracing API calls (#849, #911)
    • Error ErrMsgAlreadyAckd for a more detailed error when trying to acknowledge a message that already was. Thanks to @Berreek for the contribution (#862)
    • Made js.Subscribe() calls context aware (#872)
    • UpdateConsumer() and new consumer configuration options: MaxRequestBatch, MaxRequestExpires and InactiveThreshold (#893)
    • NakWithDelay() new acknowledgment call, and BackOff list of duration in the ConsumerConfig object (#894)
    • BackOff() subscription option. Thanks to @mfaizanse for the contribution (#933)
    • StallWait() publish option. This is the wait time (default is 200ms) that the library will wait when reaching the maximum inflight number of asynchronous publish calls (#941)
  • KeyValue:
    • Status functionality (#845)
    • MetaOnly() watcher option (#854)
    • GetRevision() to get the key at a specific revision, or ErrKeyNotFound if the key does not exist or not at the expected revision. Thanks to @boxboatmatt for the contribution (#903)
    • Placement in the KeyValueConfig structure (#929)
    • Expose nats.Context() option for the nats.KeyWatcher interface. Thanks to @boxboatmatt for the contribution (#904)
  • ObjectStore:
    • Status functionality (#845)
    • Placement in the ObjectStoreConfig structure (#929)
  • ConnectedUrlRedacted() a redacted version of ConnectedUrl() (#923)

Changed

  • JetStream:
    • The library no longer sets a default MaxAckPending when creating a JetStream consumer on Subscribe(). The selection of the value is left for the server to pick (#920)
    • The library will now try to resend a message when getting a ErrNoResponders error on a Publish() or StreamInfo() call. This is to overcome "blips" that may happen during leader changes. The action will be retried up to 2 times with a 250ms wait in between. These can be changed with the new publish options RetryWait() and RetryAttempts() (#930)
    • PublishMsgAsync() will now be limited to 4,000 maximum asynchronous publish calls inflight, if no maximum has been specified with PublishAsyncMaxPending() option.
  • KeyValue:
    • Delete() and Purge() now accept optional DeleteOpt options. The option available is LastRevision() which allows the purge or delete to be conditional to the last revision be equal to the last revision value, otherwise the operation will fail. Thanks to @steveh for the contribution (#856)
    • PurgeDeletes() will now keep markers that are less than 30 minutes by default. Also, PurgeDeletes() now accepts optional PurgeOpt values, not WatchOpt. The new DeleteMarkersOlderThan() option can be provided to change the default 30 minutes. A negative value will remove markers, regardless of their age (#906)
    • When connecting to a v2.7.2+ server, the stream for the KeyValue should be created with DiscardNew instead of DiscardOld. The library will now automatically update an existing stream for a KeyValue from DiscardOld to DiscardNew (#917)

Improved

  • Websocket:
    • Use 80 or 443 as default ports, depending on the scheme ws:// or wss://. Thanks to @cbrake for the suggestion (#879)
  • The connect failure error message when given an invalid user credentials file (#916)
  • The library will now auto-reconnect when the connection is closed on maximum connections reached from server, which could happen after a configuration reload. The library would previously have caused the connection to be permanently closed (#935)

Updated

  • Examples:
    • The Nats-echo service example to simulate a status request (#950)
    • Comment for the demo servers. Removed the TLS specific version since one can connect with TLS or not to the same port (#952)

Fixed

  • Documentation:
    • Typo in Bind go documentation. Thanks to @caspervonb for the contribution (#860)
    • Typo in SetClosedHandler. Thanks to @tormoder for the contribution (#877)
    • Typo in example_test.go. Thanks to @bvwells for the contribution (#882)
    • Comment for Subscribe method. Thanks to @ipromax for the contribution (#886)
    • Many API calls where not checking that stream and consumer names were valid, that is, did not contain a . in their name. This resulted in situations where the API would timeout because the server did not have interest on the malformed subject. Thanks to @sata-form3 for the report (#947)
  • JetStream:
    • Ordered consumers handling of auto unsubscribe (#847)
    • Activity check to handle cases when subscription was closed. Thanks to @boxboatmatt for the contribution (#873)
    • Return ErrStreamNotFound when calling AddConsumer against a missing stream (#881)
    • Prefix the error returned by StreamInfo() with nats: to match ConsumerInfo() (#928)
  • KeyValue:
    • Ensure Get() returns a nil and ErrKeyNotFound as per specification (#844)
    • Various issues, such as cancel of the context would not all the range on w.Updates() to exit, flow control, etc.. (#900, #901)
    • Use of the APIPrefix to work correctly across accounts (#910)
  • Websocket:
    • When using secure connection wss:// and a host name that resolves to multiple IPs, or when trying to reconnect to discovered servers, the (re)connection would fail with websocket invalid connection (#915)
    • Deadlock on authentication failure that manifested by a Connect() hanging forever. Thanks to @wenerme for the report (#926)

Complete Changes

v1.13.0...v1.14.0