Release v1.14.0
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
andInactiveThreshold
(#893)NakWithDelay()
new acknowledgment call, andBackOff
list of duration in theConsumerConfig
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, orErrKeyNotFound
if the key does not exist or not at the expected revision. Thanks to @boxboatmatt for the contribution (#903)Placement
in theKeyValueConfig
structure (#929)- Expose
nats.Context()
option for thenats.KeyWatcher
interface. Thanks to @boxboatmatt for the contribution (#904)
- ObjectStore:
ConnectedUrlRedacted()
a redacted version ofConnectedUrl()
(#923)
Changed
- JetStream:
- The library no longer sets a default
MaxAckPending
when creating a JetStream consumer onSubscribe()
. 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 aPublish()
orStreamInfo()
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 optionsRetryWait()
andRetryAttempts()
(#930) PublishMsgAsync()
will now be limited to4,000
maximum asynchronous publish calls inflight, if no maximum has been specified withPublishAsyncMaxPending()
option.
- The library no longer sets a default
- KeyValue:
Delete()
andPurge()
now accept optionalDeleteOpt
options. The option available isLastRevision()
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 optionalPurgeOpt
values, notWatchOpt
. The newDeleteMarkersOlderThan()
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 withDiscardNew
instead ofDiscardOld
. The library will now automatically update an existing stream for a KeyValue fromDiscardOld
toDiscardNew
(#917)
Improved
- Websocket:
- 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:
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)
- Typo in
- 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 callingAddConsumer
against a missing stream (#881) - Prefix the error returned by
StreamInfo()
withnats:
to matchConsumerInfo()
(#928)
- KeyValue:
- 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 withwebsocket invalid connection
(#915) - Deadlock on authentication failure that manifested by a
Connect()
hanging forever. Thanks to @wenerme for the report (#926)
- When using secure connection