Skip to content

Releases: nats-io/nats.go

Release v1.12.3

21 Sep 19:22
4a0ad2a
Compare
Choose a tag to compare

Changelog

JetStream users

Please review release notes from v1.12.0 regarding important changes if upgrading from an earlier release.

Fixed

  • JetStream:
    • Received message may have wrong subject. This is a regression due to an attempt to reduce subject string copy in v1.12.2 (#827)

Complete Changes

v1.12.2...v1.12.3

Release v1.12.2

20 Sep 22:07
10daedc
Compare
Choose a tag to compare

Changelog

JetStream users

Please review release notes from v1.12.0 regarding important changes if upgrading from an earlier release.

Updated

  • JetStream:
    • Go doc for subscription calls in the interface (#818)

Improved

  • Reduce memory allocation for inbound messages. Thanks to @moredure for the contribution (#824)

Fixed

  • JetStream:
    • Unblock Pull Subscribe requests on a 408 with at least a message already fetched (#823)
  • Websocket:
    • Possible panic when decoding CLOSE frame. Thanks to @byazrail for the report (#821)

Complete Changes

v1.12.1...v1.12.2

Release v1.12.1

03 Sep 22:22
42edba4
Compare
Choose a tag to compare

Changelog

JetStream users

Please review release notes from v1.12.0 regarding important changes if upgrading from an earlier release.

Added

Fixed

  • JetStream:
    • Fetch() could return immediately with a timeout error. Thanks to @izarraga for the report (#813)
  • Inboxes suffix would contain many zeros (#808)

Complete Changes

v1.12.0...v1.12.1

Release v1.12.0

26 Aug 01:13
2ea8d39
Compare
Choose a tag to compare

Changelog

Breaking Changes

This release has some important and breaking changes for the JetStream module. Previously, it was possible to create multiple instances of non queue subscriptions to the same JetStream consumer, which was wrong since each instance would get a copy of the same message and one instance acknowledging a message would mean that the other instance's message acknowledgement (or lack thereof) would be ignored. It was also possible to create queue groups against a JetStream consumer that was used by a non queue subscription.

This update requires the upcoming server version v2.4.0 to behave correctly, that is, the library will reject a "plain" subscription on a JetStream consumer that is already bound (that is, there is already an instance actively consuming from it), or on a consumer that was created for a queue group. It will also reject a queue subscription on a JetStream consumer that was not created for a queue group, or to a consumer that has been created for a different queue group. But it means that this update will not be able to create a queue subscription on a server pre v2.4.0 because those server do not have the concept of DeliverGroup in the consumer configuration.

Look at the Changed section below for the list of those changes.

The repository master branch has been renamed main. If you have a fork or a clone of the repository, you should run those git commands:

git branch -m master main
git fetch origin
git branch -u origin/main main
git remote set-head origin -a

Added

  • JetStream:
    • Bind() and BindStream() options to the subscribe calls (#740)
    • ChanQueueSubscribe() (#744)
    • APIPrefix() and Domain() options to specify prefix or domain. Thanks to @Jarema for the contribution (#750, #753)
    • Two new sentinel errors: ErrStreamNotFound and ErrConsumerNotFound. Thanks to @actatum for the contribution (#760)
    • MaxMsgsPerSubject option in the StreamConfig (#768)
    • OrderedConsumer() subscription option to create a FIFO ephemeral consumer for in order delivery of messages. There are no redelivered and no ACKs, and flow control and heartbeats will be added but be taken care of without additional user code (#789, #793)
    • DeliverSubject() option to configure the deliver subject of a JetStream consumer created by the js.Subscribe() call (and variants) (#794)
    • Fields DeliverGroup in ConsumerConfig, PushBound in ConsumerInfo. They help making prevent incorrect subscriptions to JetStream consumers (#794)
    • Field Description in StreamConfig and ConsumerConfig (#795)
    • ExpectLastSequencePerSubject() publish option (#797)
    • DeliverLastPerSubject() subscribe option (#798)
  • CustomInboxPrefix connection option to set the custom prefix instead of _INBOX. (#767)

Changed

  • JetStream:
    • Conn.JetStream() no longer looks up account information (#739)
    • With a PullSubscription, calling NextMsg() or NextMsgWithContext() will now return ErrTypeSubscription. You must use the Fetch() API (#794)
    • If the library created internally a JetStream consumer, the consumer will be deleted on Unsubscribe() or when the Drain() completes (#794)
    • Fail multiple instances of a subscription on the same durable push consumer (only one active at a time). Also, consumers now have the concept of DeliverGroup, which is the queue group name they are created for. Only queue members from the same group can attach to this consumer, and a non queue subscription cannot attach to it. Note that this requires server v2.4.0 (#794)
    • Attempting to create a queue subscription with a consumer configuration that has idle heartbeats and/or flow control will now result in an error (#794)
    • ConsumerInfo's fields Delivered and AckFloor are now SequenceInfo objects that include the last activity (in UTC time) (#802)

Improved

  • Avoid unnecessary data copy in some situations. Thanks to @Endeavourken for the contribution (#788)
  • JetStream:
    • js.PullSubscribe() implementation that reduces the number of internal subscriptions being created/auto-unsubscribed (#791)
    • Subscribe calls will now return an error if the consumer configuration specified does not match the current consumer's configuration. Thanks to @kszafran for the suggestion (#803)

Fixed

  • JetStream:
    • Possible lock inversion (#794)
    • JetStream consumers could be incorrectly deleted on subscription's Unsubscribe() (#794)
  • Removed unused code. Thanks to @rutgerbrf for the contribution (#737)
  • Misspells in go doc. Thanks to @dtest11 for the contributions (#758, #759)
  • Websocket:
    • Decompression of continuation frames (#755)

Complete Changes

v1.11.0...v1.12.0

Release v1.11.0

04 May 01:52
3b1f6fc
Compare
Choose a tag to compare

Changelog

Added

  • Message Headers support
    • Conn.HeadersSupported() returns a boolean indicating if the server, the client is currently connected to, supports headers (#582)
  • JetStream support
  • Websocket support (#719)
  • LameDuckModeHandler to be notified when the server the application is connected to enters lame-duck mode (#572)
  • RequestMsg(), RequestMsgWithContext() and RespondMsg() APIs, which makes it possible to use message headers with requests and replies (#574)
  • RetryOnFailedConnect() option, which means that the Connect() calls will not fail right away if servers are not running at the first attempt to connect. Instead, the library will behave as if it was just disconnected. Thanks to @tomwilkie, @Zambiorix, @kekoav, @mnarrell, @serajam and @hbobenicio for their feedback (#581)
  • Support for "no responders" error on requests (#576)
  • Examples:
    • TLS options in nats-pub and mats-sub examples. Thanks @egodigitus for the contribution (#615)
    • --nkey flat to enable NKey authentication (#728)

Changed

  • ErrNoResponders is now returned for a request call for which there is no application servicing the request's subject (when connecting to a server that supports the feature). Applications checking for ErrTimeout only as a "normal" error would need to be updated (#576)

Updated

  • Dependencies (#573)
  • Added a go_test.mod file to limit tests dependencies versus library dependencies (#705)

Fixed

  • Comment for PublishRequest API. Thanks to @hasheddan for the contribution (#570)
  • Comment for encoded connection's Handler. Thanks to @aym-v for the contribution (#590)
  • Possible data race between an AutoUnsubscribe() and the routine delivering messages (#726)

Complete Changes

v1.10.0...v1.11.0

Release v1.10.0

14 May 01:30
120703c
Compare
Choose a tag to compare

Changelog

Added

  • Conn.GetClientIP() returns the client IP as known by the server. Works if connected to server 2.1.6+ (#559)
  • Conn.RTT() calculates the round trip time between this client and the server (#559)

Updated

  • Protobuf import for encoder (#557)
  • Change default of Conn.Flush() from 60 to 10 seconds (#561)
  • Bump default MAX_CONTROL_LINE to 4096 (#567)

Fixed

  • Possible panic on connect if discovered server list shrinks in that process. Thanks to @kirill256 for the contribution (#550)
  • Conn.Request() with UseOldRequest option was not returning on connection Conn.Close() (#558)
  • Added jitter to the reconnection logic (#564)
  • Randomize discovered server URLs (unless NoRandomize() option is set) (#566)

Complete Changes

v1.9.2...v1.10.0

Release v1.9.2

30 Mar 23:56
4d5d5d1
Compare
Choose a tag to compare

Changelog

Added

  • Option to set the reply subject in nats-pub example (#539)
  • The queue group name in nats-qsub example (#541)

Improved

  • Reduced lock contention for connections receiving their own messages (#529)

Updated

  • Dependencies, covering the golang crypto package CVE. The CVE mentions the ssh package, which this library does not use, so NATS Go client should not be affected. Thanks to @KauzClay for the contribution (#548)

Fixed

  • Do not use sync.Once.Do() in connection's first request. Thanks to @hubinix for the report (#538)

Complete Changes

v1.9.1...v1.9.2

Release v1.9.1

31 Oct 23:57
6063d67
Compare
Choose a tag to compare

Changelog

Fixed

  • In preparation for JetStream and support of subject rewriting, a bug was introduced that would cause multiple deliveries when before the delivery should have been only one per response. This affects only v1.9.0 (#528)

Complete Changes

v1.9.0...v1.9.1

Release v1.9.0

30 Oct 18:17
41e7eae
Compare
Choose a tag to compare

Changelog

With the release of Go 1.13.3, the go get github.com/nats-io/nats.go is now working!

Added

  • Notes in README on using go get and Go modules (#481)
  • NoCallbacksAfterClientClose() connection option to prevent invocation of connection callback on explicit Close() (#514)

Updated

  • Examples (log error, use Drain(), etc..)
  • Replaced use of DisconnectHandler with DisconnectErrHandler in our examples. Thanks to @kaxap for the contribution (#504)

Improved

  • When creating a subscription, error will now be reported if using a bad subject or queue name (#500)
  • Support for ~ when providing the user credentials file(s) (#512)

Fixed

  • Document issues. Thanks to @JensRantil for the report.
  • Some errors in code examples in the README. Thanks to @thylong for the contribution (#507)
  • Allow synchronous subscriptions to use msg.Respond() when `AutoUnsubscribe() is used (#489)
  • Wrong error returned in NextMsg() and NextMsgWithContext(). Thanks to @ekle for the report (#492)
  • Handling of expiration and auth errors on reconnect (#499, #506)
  • Data race between processMsg() and Stats(). Thanks to @Will2817 for the report (#521)

Complete Changes

v1.8.1...v1.9.0

Release v1.8.1

03 Oct 14:56
e2837a2
Compare
Choose a tag to compare

Changelog

Updated

  • NATS Server import paths in tests (include the /v2 token) (#479)

Complete Changes

v1.8.0...v1.8.1