Releases: nats-io/nats.go
Release v1.12.3
Release v1.12.2
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
Fixed
- JetStream:
- Unblock Pull Subscribe requests on a 408 with at least a message already fetched (#823)
- Websocket:
Complete Changes
Release v1.12.1
Changelog
JetStream users
Please review release notes from v1.12.0 regarding important changes if upgrading from an earlier release.
Added
- Stringer for connection's
Status()
. Thanks to @josephwoodward for the contribution (#812)
Fixed
- JetStream:
- Inboxes suffix would contain many zeros (#808)
Complete Changes
Release v1.12.0
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()
andBindStream()
options to the subscribe calls (#740)ChanQueueSubscribe()
(#744)APIPrefix()
andDomain()
options to specify prefix or domain. Thanks to @Jarema for the contribution (#750, #753)- Two new sentinel errors:
ErrStreamNotFound
andErrConsumerNotFound
. Thanks to @actatum for the contribution (#760) MaxMsgsPerSubject
option in theStreamConfig
(#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 thejs.Subscribe()
call (and variants) (#794)- Fields
DeliverGroup
inConsumerConfig
,PushBound
inConsumerInfo
. They help making prevent incorrect subscriptions to JetStream consumers (#794) - Field
Description
inStreamConfig
andConsumerConfig
(#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
, callingNextMsg()
orNextMsgWithContext()
will now returnErrTypeSubscription
. You must use theFetch()
API (#794) - If the library created internally a JetStream consumer, the consumer will be deleted on
Unsubscribe()
or when theDrain()
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 fieldsDelivered
andAckFloor
are nowSequenceInfo
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:
- 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
Release v1.11.0
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()
andRespondMsg()
APIs, which makes it possible to use message headers with requests and replies (#574)RetryOnFailedConnect()
option, which means that theConnect()
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
andmats-sub
examples. Thanks @egodigitus for the contribution (#615) --nkey
flat to enable NKey authentication (#728)
- TLS options in
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 forErrTimeout
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
Release v1.10.0
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()
withUseOldRequest
option was not returning on connectionConn.Close()
(#558)- Added jitter to the reconnection logic (#564)
- Randomize discovered server URLs (unless
NoRandomize()
option is set) (#566)
Complete Changes
Release v1.9.2
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
Complete Changes
Release v1.9.1
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
Release v1.9.0
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
withDisconnectErrHandler
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()
andNextMsgWithContext()
. Thanks to @ekle for the report (#492) - Handling of expiration and auth errors on reconnect (#499, #506)
- Data race between
processMsg()
andStats()
. Thanks to @Will2817 for the report (#521)