Release v1.17.0
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 acceptsStreamPurgeRequest
as an option, allowing partial purge by subject sequence number or keeping selected number of messages (#988) - Option to fetch
DeletedDetails
when fetchingStreamInfo
.StreamInfo()
now acceptsStreamInfoRequest
allowing to passDeletedDetails
flag (#990) - Option to report subjects on
StreamInfo()
request.StreamInfo()
now acceptsStreamInfoRequest
allowing to passSubjectsFilter
value (#1010) - Support
AllowDirect
in stream configuration, enabling faster access to individual messages on a stream (#991) - Support for
DirectGet
API inGetMsg()
throughDirectGet()
andDirectGetNext()
options (#1020, #1030) HeadersOnly
option toRePublish
field on stream configuration and change struct name toRePublish
(#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 singleFetch()
can receive (#1043)- Filter streams and stream names by subject in
StreamsInfo()
andStreamNames()
usingStreamListFilter()
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 inSubscribe()
. Thanks to @goku321 for the contribution (#1078)
- Support for enhanced stream purge.
-
KV:
RePublish
option on key value configuration (#1031)
-
ObjectStore:
ObjectStores()
andObjectStoreNames()
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 usingerrors.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 nativeerrors
package (#1044, #1047) - Force
Subscribe()
to use memory storage and no replicas when usingOrderedConsumer()
(#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)
- Add
-
KV:
- Utilize
DirectGet()
in KV for improved performence (#1020)
- Utilize
-
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:
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 creatingJetStreamContext
(#1080) - Add missing fields to
AccountInfo
schema (#1026) - Align
StreamSourceInfo
schema with server (#1039)
- [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
-
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 whenAckPolicyNone
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 whenjsi
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 whenReader
returns both value andEOF
. Thanks to @tinou98 for the contribution (#995) - Invalid digest decoding on object
Get()
, not propagating errors fromGet()
to the user (#1052) - Allow updating meta if new name exists but is deleted (#1053)
- Disallow adding links in
Put()
object meta (#1057)
- Update object
-
Typo in
CustomInboxPrefix()
error message. Thanks to @subtle-byte for the contribution (#1028) -
Ignore trailing comma at the end of URL lists (#1058)