Nats.go Versions Save

Golang client for NATS, the cloud native messaging system.

v1.28.0

9 months ago

Changelog

Overview

This release focuses on a set of changes and improvements in new JetStream API. With this release, JetStream API is out of preview. Additionally, with this release support for go version < 1.18.0 is dropped, due to usage of any type in codebase.

Added

  • JetStream:
    • HeadersOnly field on OrderedConsumerConfig (#1327)
    • WithStreamListSubject() option to filter results of ListStreams() and StreamNames() by stream name (#1312)

Improved

  • Added dev and main branches of nats-server to tests in CI (#1336)
  • Core NATS:
    • Fixed incorrect test case in parse_test.go. Thanks @YukiBobier for the contribution (#1334)
  • JetStream:
    • Fix typos and doc comments in new JetStream API. Thanks @mdawar for the contribution (#1339)
    • Fixed and slightly enhanced the basic example in jetstream package. Thanks to @pwntr for the contribution (#1340)
    • Improvements in in jetstream/README.md (#1347, #1350)

Changed

  • Replace interface{} with any across the codebase (#1332)
  • JetStream:
    • [BREAKING CHANGE] Move NakWithDelay to separate method, instead of it being an option on Nak() (#1337)
    • [BREAKING CHANGE] Simplified API for listing streams and stream names (#1312)
    • Add default timeout when context.Background() or context.TODO() is used (#1348)

Fixed

  • JetStream:
    • Create consumer when calling OrderedConsumer() (#1317)
    • Unset start time for ordered consumer on reset (#1341)
    • Fixed Next() blocking indefinitely after calling Stop(). Thanks @mdawar for the contribution (#1344)
    • Invalid missing heartbeat errors in Consume() (#1345)
    • Fixed PublishAsync() blocking published due to PublishAsyncMaxPending not being reset on reconnect (#1346)
  • Legacy JetStream:
    • Fixed PublishAsync() blocking published due to PublishAsyncMaxPending not being reset on reconnect (#1346)

Complete Changes

https://github.com/nats-io/nats.go/compare/v1.27.1...v1.28.0

v1.27.1

10 months ago

Changelog

Improved

  • JetStream Simplified API:
    • Fixed unit from kB to B for FetchBytes() in jetstream/README.md. Thanks @fabiant7t for the contribution! (#1329)
    • Add param names in API interfaces to better document the code (#1316)

Fixed

  • JetStream Simplified API:
    • Use custom inbox prefix set on nats.Conn for pull requests. Thanks @oderwat for the contribution! (#1322)
  • Object Store:
    • Fixed race condition in object store when nats.Context is used. Thanks @anthonyjacques20 for the contribution! (#1314)
  • JetStream:
    • Fixed creating a consumer with Durable not set on server versions prior to 2.9.0 (#1325)

Complete Changes

https://github.com/nats-io/nats.go/compare/v1.27.0...v1.27.1

v1.27.0

11 months ago

Changelog

Overview

This release focuses on improvements to new JetStream API and Service API (micro) preview functionalities.

Added

  • JetStream Simplified API:
    • StreamNameBySubject() method for stream discovery based on provided subject (#1292)

Improved

  • JetStream Simplified API:
    • Simplified lock handling for Consume() and Messages() (#1303)

Changed

  • JetStream Simplified API:
    • [BREAKING CHANGE] Renamed AddConsumer to CreateOrUpdateConsumer. This change is introduced in anticipation for separation of create and update operations in nats-server (#1300)
    • [BREAKING CHANGE] Change default AckPolicy to AckPolicyExplicit (#1278)
    • [BREAKING CHANGE] Fixed typo in PullThresholdBytes type name (#1300)
    • [BREAKING CHANGE] Removed push consumer only fields from ConsumerConfig (#1300)
    • [BREAKING CHANGE] Removed context.Context from PublishAsync and PublishMsgAsync (#1300)
  • Service API (micro):
    • [BREAKING CHANGE] More verbose endpoint INFO schema (#1277)
      • Endpoint metadata was moved from STATS response to INFO response
      • INFO now returns endpoints object, containing subject, name and metatada. This replaces subject field.

Fixed

  • JetStream Simplified API:
    • Fixed data race on ErrNoHeartbeat. Thanks @alexisvisco for the contibution! (#1291)
    • Fixed incorrect example in jetstream/README.md). Thanks @bojanz for the contribution! (#1295)
  • Object Store:
    • Fixed leaking goroutines after calling Put() and PutBytes() (#1282)
  • Flaky tests picking the used port for cluster connections (#1284, #1298)
  • Division by zero fixes in bechmark tests. Thanks @Zamony fot the contribution! (#1293)

Complete Changes

https://github.com/nats-io/nats.go/compare/v1.26.0...v1.27.0

v1.26.0

11 months ago

Changelog

Overview

This release adds beta functionality of JetStream simplified API. The goal of this API is to simplify and streamline stream and consumer management, as well as leverage pull consumers for continuous message retrieval. We encourage you to give it a try and post your feedback!

You can find more details on the new API here

Added

  • JetStream Simplified API:
  • JetStream:
    • ConsumerName() subscribe option to set Name in ConsumerConfig when creating a consumer (#1263)
    • SkipConsumerLookup() subscribe option to bypass verifying if the consumer exists before consumer creation (#1265)

Improved

  • Added README.md for micro directory (#1271)
  • Refactored internal handler service monitoring setup in micro (#1240)
  • Added goleak to check for leaking goroutines in tests (#1268)

Changed

  • JetStream:
    • Generate consumer name in Subscribe() when name is not provided to leverage 2.9.0 consumer create server API (#1261, #1263)
  • Service API (micro):
    • Removed api_urland SCHEMA endpoint (#1270)
    • Avoid producing nil metadata (#1242)
  • Changed compression library for websockets (#1259)
  • Reload client TLS certificates and Root CAs on reconnect (#1264)

Fixed

  • Object Store
    • Fixed Put purging partial object before acks for all sent chunks were received. This caused leftover chunks to be processed after purge (#1260)
    • Fixed issue in Read where nil was returned instead of context error (#1260)
  • JetStream:
    • Fixed flaky TestJetStreamConcurrentQueueDurablePushConsumers test (#1267)
  • Fixed leaking goroutines in tests (#1268)

Complete Changes

https://github.com/nats-io/nats.go/compare/v1.25.0...v1.26.0

v1.25.0

1 year ago

Changelog

Added

  • Service API (micro):
    • Support metadata for services, endpoints and endpoint stats (#1231, #1233)

Improved

  • Fix TestJetStreamStreamInfoWithSubjectDetails test (#1225)
  • Fix typo in JetStream Durable() option comment. Thanks @jlvallelonga fot the contribution (#1229)
  • Bump nkeys to latest version (#1235)

Changed

  • JetStream:
    • Use wildcard subscription for pull subscription and separate inbox per Fetch()/FetchBatch(). Additionaly, FetchBatch() now verifies whether a request timeout was received for a current pull request (#1237, #1238)

Complete Changes

https://github.com/nats-io/nats.go/compare/v1.24.0...v1.25.0

v1.24.0

1 year ago

Changelog

Added

  • Core:
    • Option to skip host lookup. Thanks to @chen-shmilovich-sysdig for the contribution (#1204)
  • JetStream
    • FetchChan method to utilize non-blocking pull subscription requests (#1211)
  • Service API (micro):
    • ContextHandler helper function which implements micro.Handler and allows passing context.Context to request handler (#1215)

Improved

  • Use go 1.19 in go.mod and skip using deprecated rand.Seed for go version +1.20 (#1209)

Fixed

  • JetStream:
    • Retry recreating ordered consumer on insufficient resources error (#1217)
    • Stream and consumer name validation now checks for space in name, preventing timeouts and returning valid error (#1219)
  • Service API (micro):
    • Avoid panic on schema request when no schemas were given (#1195)
  • KV:
    • Fix CreateKeyValue idempotency check on AllowDirect when upgrading server version to > 2.9.0 Thanks to @dbason for the contribution (#1213)

Complete Changes

https://github.com/nats-io/nats.go/compare/v1.23.0...v1.24.0

v1.23.0

1 year ago

Changelog

Overview

This release focuses on improvements in micro package, most notably adding a possibility to create a service with multiple endpoints.

Added

  • Service API (micro):
    • Support for multi-endpoint services (#1180)
    • type field in monitoring handlers responses (#1173)

Changed

  • JetStream:
    • Optimize AddConsumer() performance by not sending JS request if consumer config has not changed (#1185)
  • Service API (micro):
    • Use interface instead of struct for micro.Request (#1174)
    • Use time.Time instead of string for Started field in STATS response (#1175)
    • Service schemas are now defined per-endpoint.

Improved

  • Check whether credentials in nats.Connect() are missing before using them (#1181)
  • Reduce the size of the bufio.Reader for message header parsing. Thanks to @thomas-long-f3 for the contribution (#1187)
  • Update go version in go.mod to 1.18 and update go version used by Travis (#1182)
  • Start adopting error wrapping syntax (%w) in various errors (#1182)
  • Added note on disabling reconnect buffer on nats.ReconnectBufSize() (#1169)
  • Fix typos in comments in micro package. Thanks to @chenjpu for the contribution (#1171)

Fixed

  • JetStream
    • Pass opts to ConsumerInfo call in AddConsumer() (#1176)
    • Use custom inbox prefix in async reply. Thanks to @guyguy333 for the contribution (#1190)

Complete Changes

https://github.com/nats-io/nats.go/compare/v1.22.1...v1.23.0

v1.22.1

1 year ago

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

https://github.com/nats-io/nats.go/compare/v1.22.0...v1.22.1

v1.22.0

1 year ago

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

https://github.com/nats-io/nats.go/compare/v1.21.0...v1.22.0

v1.21.0

1 year ago

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

https://github.com/nats-io/nats.go/compare/v1.20.0...v1.21.0