Skip to content

Releases: nats-io/nats.go

Release v1.22.1

22 Dec 14:10
6600948
Compare
Choose a tag to compare

Changelog

Changed

  • Service API:
    • Monitoring subjects for a service are no longer uppercase (#1166)
    • Changed RequestHandler signature to no longer return an error (#1166)

Complete Changes

v1.22.0...v1.22.1

Release v1.22.0

20 Dec 13:24
61a9345
Compare
Choose a tag to compare

Changelog

Overview

This release adds a beta implementation of micro package, which provides API for creating and monitoring microservices on top of NATS connection.

Added

  • Service API beta implementation (#1160)
  • Getters for connection callbacks (#1162)

Complete Changes

v1.21.0...v1.22.0

Release v1.21.0

05 Dec 16:15
6c6add8
Compare
Choose a tag to compare

Changelog

Added

  • ConnectHandler connect option to detect that initial connection was established. This is especially useful when combined with RetryOnFailedConnect (#1133 )
  • IgnoreAuthErrorAbort connect option to prevent aborting reconnect attempts after receiving the same authentication error twice (#1141)
  • SkipTLSHandshake option to CustomDialer. SkipTLSHandshake method can be implemented on a custom dialer to prevent TLS handshake if not needed (#1147)
  • KV:
    • Return ErrKeyExists error when attempting to Create() a KV pair for an existing key (#1135, #1136)
  • JetStream:
    • Add ErrLeadershipChanged error, returned when consumer leadership has changed during a pull request on a consumer. Thanks to @sata-form3 for the contribution (#1151)

Improved

  • Remove deprecated usages of io/ioutil. Thanks to @cesarvspr for the contribution (#1150)
  • Remove experimental notice from KV implementation (#1154)

Complete Changes

v1.20.0...v1.21.0

Release v1.20.0

11 Nov 15:19
5c57d4b
Compare
Choose a tag to compare

Changelog

Changed

  • JetStream:
    • [BREAKING CHANGE] Extract nats: Consumer Deleted server error to ErrConsumerDeleted variable. This error is returned when consumer is deleted while waiting on pull request and was introduced in nats-server v2.9.6 (#1125)

Improved

  • JetStream:
    • Fix broken comments on ErrConsumerNameAlreadyInUse and StreamNameBySubject(). Thanks to @subtle-byte for the contribution (#1128)
  • Core NATS:
    • Improve comment on RetryOnFailedConnect connect option (#1127)

Complete Changes

v1.19.1...v1.20.0

Release v1.19.1

05 Nov 09:31
980f955
Compare
Choose a tag to compare

Changelog

Added

  • JetStream:
    • Expose StreamNameBySubject method on JetStreamContext interface for looking up stream by subject (#1114)
    • Return stream alternates when fetching stream info (#1118)

Changed

  • KV:
    • Use BindStream for watcher so it works with mirrors (#1116)

Fixed

  • KV:
    • Delete key not working correctly across mirrors (#1115)

Complete Changes

v1.19.0...v1.19.1

Release v1.19.0

27 Oct 19:35
Compare
Choose a tag to compare

Changelog

Added

  • KV:
    • Support for KV mirrors and sources (#1112)

Improved

  • JetStream:
    • Comment on InactiveThreshold to align with server version 2.9.0. Thanks to @neilalexander for the contribution (#1106)

Experimental

  • Added Service framework for microservice communication using core NATS. This is an experimental preview and may be changed in future releases (#1111)

Complete Changes

v1.18.0...v1.19.0

Release v1.18.0

12 Oct 18:38
885ad13
Compare
Choose a tag to compare

Changelog

Added

  • JetStream:
    • Support for DiscardNewPerSubject on stream configuration (#1102)
  • KV:
    • KeyValueStores() and KeyValueStoreNames() methods for listing key value buckets (#1088)
    • Bytes() method on KeyValueStatus returning size of the bucket (#1092)

Improved

  • JetStream:
    • Comment on Subscribe() method in JetStream interface now has a better description of the behavior after unsubscribing from a durable consumer. Thanks to @sylr for the contribution (#1100)

Changed

  • JetStream:
    • Ordered consumer is now being recreated on missing heartbeat (#1097)
    • AckNone policy can now be set for pull consumers (#1090)
  • ObjectStore:
    • [BREAKING] ObjectStores() now returns channel of ObjectStoreStatus instead of ObjectStore interface (#1099)
    • [BREAKING] Options on various ObjectStore methods now have individual types (GetObjectOpt, GetObjectInfoOpt and ListObjectsOpt). Only options applicable for a particular method can be used (#1091)
    • [BREAKING] When listing/fetching object info, deleted objects are now hidden by default. New options are added to enable fetching deleted objects (GetObjectInfoShowDeleted(), GetObjectShowDeleted() and ListObjectsShowDeleted() (#1091)

Fixed

  • JetStream:
    • Invalid JSON tag on Tiers field on AccountInfo struct (#1095)

Complete Changes

v1.17.0...v1.18.0

Release v1.17.0

16 Sep 16:24
715a591
Compare
Choose a tag to compare

Changelog

IMPORTANT

This release uses a new consumer create API when interacting with nats-server version 2.9.0 or higher. This changes the subjects used by the client to create consumers, which might in some cases require changes in access and import/export configuration. To opt out of this feature, use UseLegacyDurableConsumers() option when creating JetStreamContext.

Added

  • JetStream:

    • Support for enhanced stream purge. PurgeStream() now accepts StreamPurgeRequest as an option, allowing partial purge by subject sequence number or keeping selected number of messages (#988)
    • Option to fetch DeletedDetails when fetching StreamInfo. StreamInfo() now accepts StreamInfoRequest allowing to pass DeletedDetails flag (#990)
    • Option to report subjects on StreamInfo() request. StreamInfo() now accepts StreamInfoRequest allowing to pass SubjectsFilter value (#1010)
    • Support AllowDirect in stream configuration, enabling faster access to individual messages on a stream (#991)
    • Support for DirectGet API in GetMsg() through DirectGet() and DirectGetNext() options (#1020, #1030)
    • HeadersOnly option to RePublish field on stream configuration and change struct name to RePublish (#991)
    • SecureDeleteMsg() method to securely delete and overwrite a message on a stream (#1025)
    • MaxRequestMaxBytes() PullConsumer() option allowing setting the maximum number of bytes a single Fetch()can receive (#1043)
    • Filter streams and stream names by subject in StreamsInfo() and StreamNames() using StreamListFilter() option (#1062)
    • Accept AckAll for pull consumers. Thanks to @neilalexander for the contribution (#1063)
    • Support for setting consumer replicas through Subscribe() options. Thanks to @goku321 for the contribution (#1019)
    • Support for setting memory storage on consumer with ConsumerMemoryStorage() option in Subscribe(). Thanks to @goku321 for the contribution (#1078)
  • KV:

    • RePublish option on key value configuration (#1031)
  • ObjectStore:

    • ObjectStores() and ObjectStoreNames() methods for listing object store buckets (#1074)
  • TLSConnectionState() to expose TLS connection state (#996)

  • UserJWTAndSeed helper function accepting JWT and seed as parameters (#1046)

  • natsProtoErr type for proto error normalization and comparison using errors.Is() (#1082)

Improved

  • JetStream

    • Add JetStreamError type for all JetStream related errors, containing error codes (for API errors). JetStreamError supports comparing and unwrapping errors using native errors package (#1044, #1047)
    • Force Subscribe() to use memory storage and no replicas when using OrderedConsumer() (#989)
    • Consistent error value of context timeout when using Fetch() on pull subscription. Thanks to @wdhongtw for the contribution (#1011)
    • Add additional note to PullSubscribe() on durable semantics (#994)
  • KV:

    • Utilize DirectGet() in KV for improved performence (#1020)
  • Add support for reporting flusher errors. THanks to @GeorgeEngland for the contribution (#1015)

  • Mention field defaults in Options struct documentation. Thanks to @costela for the contribution (#1013)

Changed

  • JetStream:
    • DeleteMsg() now uses NoErase option by default, not overwriting the message on stream (only marking it as deleted) (#1025)
    • StreamInfo() will now return all subjects when requested (#1072)

Updated

  • JetStream:

    • [BREAKING] Use new consumer create API when interacting with nats-server version 2.9.0 or higher. This changes the subjects used by the client to create consumers, which might in some cases require changes in access and import/export configuration. To opt out of this feature, use UseLegacyDurableConsumers() option when creating JetStreamContext (#1080)
    • Add missing fields to AccountInfo schema (#1026)
    • Align StreamSourceInfo schema with server (#1039)
  • Use nats-server 2.9.0 in tests (#1073)

  • Add new test TLS certs and run tests for go 1.18 in CI (#1023, #1055)

Fixed

  • JetStream

    • Subscribe() automatically sending ACK when AckPolicyNone is set (#987)
    • Return error when attempting to ACK a message on a AckNone consumer (#1032)
    • Use native time.Time.Equal method for equality check when comparing consumer configs (#993)
    • Ephemeral PullConsumer's Fetch() failing with "no responders" (#1022)
    • ConsumerInfo nil pointer dereference when jsi is not initialized. Thanks to @Sergey-Belyakov for the contribution (#1024)
    • Paging in stream and consumer name listing (#1060)
  • ObjectStore

    • Update object Put() to avoid loosing last chunk when Reader returns both value and EOF. Thanks to @tinou98 for the contribution (#995)
    • Invalid digest decoding on object Get(), not propagating errors from Get() to the user (#1052)
    • Allow updating meta if new name exists but is deleted (#1053)
    • Disallow adding links in Put() object meta (#1057)
  • Typo in CustomInboxPrefix() error message. Thanks to @subtle-byte for the contribution (#1028)

  • Ignore trailing comma at the end of URL lists (#1058)

Complete Changes

v1.16.0...v1.17.0

Release v1.16.0

26 May 20:41
b795e86
Compare
Choose a tag to compare

Changelog

Added

  • JetStream:
    • Experimental: StreamConfig.RePublish configuration, which is a SubjectMapping (source/destination) which allows the republish of a message after being sequenced and stored (#980)
    • Experimental: Two new ConsumerConfig fields: Replicas and MemoryStorage which are generally inherited by parent stream, but can be configured directly (#980)
  • Websocket:
    • ProxyPath() option to add a path to websocket connection URLs. Thanks to @ido-gold-apolicy for the contribution (#974)

Complete Changes

v1.15.0...v1.16.0

Release v1.15.0

04 May 22:09
f52eb7b
Compare
Choose a tag to compare

Changelog

Experimental

The ObjectStore is still experimental and subject to change.

Added

  • ObjectStore:
    • MaxBytes in the ObjectStoreConfig structure (#955)

Improved

  • JetStream:
    • Ability pass 0 to nats.ExpectLastSequence(0) and nats.ExpectLastSequencePerSubject(0) to the js.Publish() call. Previously, the value 0 would be ignored and the header would not be set. Note that currently, the server only accepts 0 as a valid value for nats.ExpectLastSequencePerSubject(). Thanks to @bruth for the contribution (#958)

Fixed

  • JetStream:
    • A PullConsumer's Fetch() method with a batch greater than 1 and with other pull consumers running, may timeout although messages would have been available (#967)

Complete Changes

v1.14.0...v1.15.0