chore(deps): Update module github.com/nats-io/nats.go to v1.55.0 #160

Open
renovate-bot wants to merge 1 commits from renovate/github.com-nats-io-nats.go-1.x into main
Owner

This PR contains the following updates:

Package Change Age Confidence
github.com/nats-io/nats.go v1.37.0 → v1.55.0 age confidence

Release Notes

nats-io/nats.go (github.com/nats-io/nats.go)

v1.55.0

Compare Source

Changelog

This is the biggest nats.go release in a long time: 47 changes with more than half of them coming from 18 external contributors - thank you all!

Most of this release is a robustness effort. Nearly 30 bug fixes address deadlocks, goroutine and timer leaks, data races and stalls in reconnect and drain handling, pull and ordered consumers, async publish and service API. It also adds the FetchMaxBytes() option and Conn.RemoteAccount().

ADDED
  • Core NATS:
    • Conn.RemoteAccount() and ServerInfo.RemoteAccount exposing the account the client is bound to (#​2156)
  • JetStream:
    • FetchMaxBytes() option to limit both the number of messages and total bytes in a single Fetch() request. Thanks @​manenim for the contribution (#​2198)
    • StreamInfo.Domain, StreamInfo.Alternates, StreamState.Lost, StreamSourceInfo.External and StreamSourceInfo.Error in stream info (#​2168)
    • ErrStreamMessageExceedsMaximum for JetStream error code 10054, returned when a message exceeds the stream's MaxMsgSize. Thanks @​matehsan for the contribution (#​2110)
FIXED
  • Core NATS:
    • ForceReconnect() called while already reconnecting disabling ReconnectWait and custom reconnect delays, so the client dialed in a tight loop. Thanks @​Arsen302 for the contribution and @​MokiMeow for the diagnosis and test (#​2179)
    • Connection closing for good instead of reconnecting after a partial write left a truncated message on the wire (#​2169)
    • Connection status listeners losing an unread event and being unregistered when the next status was sent (#​2193)
    • Message headers not counted against subscription pending byte limits, so header-heavy subscriptions could exceed the limit without reporting a slow consumer. Thanks @​Grivn for the contribution (#​2200)
    • Requests interrupted by a reconnect returning ErrConnectionClosed instead of ErrDisconnected. Thanks @​AshSgDe29071999 for the contribution (#​2129)
    • Default port added to the path instead of the host for server URLs with a path and no port, e.g. ws://host/nats. Thanks @​dannyshafer for the contribution (#​2177)
    • Close() during Drain() flipping the closed connection back to DRAINING_PUBS and flushing on it. Thanks @​Kshot3000 for the contribution (#​2163)
    • Drain() waiting for the full DrainTimeout when the connection was closed mid-drain (#​2171)
    • IsSystemAccount() reset to false by async INFO updates, such as cluster topology changes or lame duck mode (#​2156)
  • JetStream:
    • Pull consumer Consume() and Messages() deadlocking on Stop() or Drain() while buffered messages were still being delivered. Thanks @​clwluvw for the contribution (#​2165)
    • Messages() iterator goroutines leaking after the connection is closed. Thanks @​clwluvw for the contribution (#​2166)
    • Heartbeat timer and status listener left running when Consume() ends because the connection was closed. Thanks @​clwluvw for the contribution (#​2164)
    • Messages() iterator returning ErrMsgIteratorClosed instead of the remaining buffered messages when Next() raced with Drain() (#​2188)
    • Pull consumer with StopAfter stalling until the missed heartbeat check (30s by default) after a pull expired. Thanks @​huynguyen7 for the contribution (#​2208)
    • Ordered consumer with StopAfter hanging on Stop()/Drain(), delivering too many or too few messages, or panicking after a consumer reset. Thanks @​clwluvw for the contribution (#​2167)
    • Ordered consumer Fetch(), Next() and FetchBytes() blocking forever after returning ErrOrderedConsumerConcurrentRequests, and FetchNoWait() restarting from the beginning of the stream (#​2211)
    • Ordered consumer Consume() and Messages() using the 15s pull consumer heartbeat instead of the 5s ordered default, so a stalled consumer was reset after ~30s instead of ~10s. Thanks @​arminazimi for the contribution (#​2182)
    • PublishAsync() exceeding WithPublishAsyncMaxPending() under concurrent calls. Thanks @​ShravanthReddy for the contribution (#​2126)
    • Async publish error callbacks for messages pending during a reconnect delayed until the publisher shut down. Thanks @​H-XX-D for the contribution (#​2150)
    • Data race between Info() and CachedInfo() on streams and consumers. Thanks @​vulragrag-star for the contribution (#​2152)
    • Reusing the same KeyValueConfig.Sources for several KeyValue buckets carrying the first bucket's subject transform into the next ones, so their reads returned ErrKeyNotFound. Thanks @​zhechen-cs for the contribution (#​2190)
    • Object Store GetFile() leaving trailing bytes of an existing destination file when downloading a shorter object. Thanks @​zhechen-cs for the contribution (#​2197)
  • Legacy JetStream:
    • Async publish error callbacks for messages pending during a reconnect delayed until the publisher shut down. Thanks @​H-XX-D for the contribution (#​2150)
    • KeyValue Create() and Update() on a cross-domain mirrored bucket failing with nats: no response from stream. Thanks @​spicysharkco for the contribution (#​2203)
    • Object Store GetFile() leaving trailing bytes of an existing destination file when downloading a shorter object. Thanks @​zhechen-cs for the contribution (#​2197)
  • Service API:
    • Panic in AddService() on a closed connection (#​2154)
    • Panic with send on closed channel when callbacks were queued during Stop() (#​2173)
    • Service stopping on async errors from unrelated subscriptions with overlapping subjects. Async errors are now matched by subscription, recorded in endpoint stats and passed to ErrorHandler, and only a closed connection stops the service (#​2174)
    • Stopping one service detaching the other services on the same connection from async errors and connection close (#​2178)
    • Service and endpoint metadata changing after it was set, when the application modified the maps passed to or returned by the service (#​2194)
    • Reset() clearing the endpoint queue group reported in stats (#​2195)
IMPROVED
  • Core NATS:
    • Report Maximum Control Line Exceeded to the async error handler before closing the connection. Thanks @​kave08 for the contribution (#​2184)
    • Avoid extra allocations in DecodeHeadersMsg. Thanks @​0xAozora for the contribution (#​2132)
    • Compute header size in Msg.Size() without serializing headers. Thanks @​0xAozora for the contribution (#​2125)
    • Document that Subscription is safe for concurrent use and that Msg is not reused after delivery. Thanks @​kave08 for the contributions (#​2183, #​2204)
  • JetStream:
    • Avoid heap allocation of publish options when publishing without options. Thanks @​0xAozora for the contribution (#​2124)
    • Avoid per-message metadata allocations in Fetch(), ordered consumers and Object Store Watch() (#​2212)
  • Legacy JetStream:
    • Avoid per-message metadata allocations in Object Store Watch() (#​2212)
    • Document the default MaxAckPending for subscriptions that create their own consumer (#​2213)
  • Tests handle v2 ack subjects, which nats-server main now sends by default (#​2192, #​2186)
  • Fix ordered consumer test exceeding 1000 consumers (#​2155) and bump the tester to fix intermittent server config parse errors (#​2170)
Complete Changes

v1.54.0

Compare Source

Changelog

This release raises the minimum supported Go version to 1.26 and adds support for nats-server v2.15 stream and consumer info fields.

ADDED
  • Core NATS:
    • nats.MultipathTCP() option to enable or disable MPTCP for outbound connections (#​2145)
    • Conn.ConnectedDomain() to read the JetStream domain advertised by the connected server (#​2139)
  • JetStream:
    • ClusterInfo.Desired, PeerInfo.Peer, PeerInfo.Pending and StreamSourceInfo.Seq in stream and consumer info, reported by nats-server v2.15 (#​2144)
    • Nats-Schedule-Rollup header const and WithScheduleRollup() publish option (#​2142)
FIXED
  • Core NATS:
    • Panic in DecodeHeadersMsg on inline status tokens shorter than 3 characters. Thanks @​nikitha-m for the contribution (#​2101)
    • Data race on Subscription.sid between applyNewSID and removeSub (#​2122)
  • JetStream:
    • Messages() iterator going silent after a reconnect that completes between Next() calls. Thanks @​1995parham for the contribution (#​2135)
    • Legacy ordered consumer silently losing messages when the subscription hits its pending limits (#​2137)
    • Legacy ordered consumer reset resurrecting an unsubscribed or draining subscription (#​2133)
IMPROVED
  • Core NATS:
    • Avoid allocation when parsing header message arguments with a fifth token. Thanks @​0xAozora for the contribution (#​2130)
    • Preallocate reply subject buffers. Thanks @​0xAozora for the contribution (#​2123)
  • JetStream:
    • Prevent doErr closure escaping to the heap in async publish reply handling. Thanks @​0xAozora for the contribution (#​2127)
    • Fix typo in Publisher interface methods comment. Thanks @​sreeram77 for the contribution (#​2120)
  • Minimum Go version is now 1.26 (#​2146)
  • Bump klauspost/compress to v1.20.0 and nkeys to v0.4.16 (#​2117, #​2146)
  • Tests run locally without docker via an in-process ntf tester (#​2131), and CI now runs against nats-server v2.15.0 (#​2146)
  • Fix flaky cluster restart tests (#​2141) and list consumers test against latest server (#​2138)
Complete Changes

v1.53.1

Compare Source

Changelog

This is a patch release containing no functional changes.

FIXED
  • Version const and the README install line, which were not updated for v1.53.0 (#​2118)
Complete Changes

v1.53.0

Compare Source

Changelog

ADDED
  • JetStream:
    • WithPublishAsyncAckHandler option for JetStream async publish. Thanks @​occamist for the contribution (#​2109)
    • AckFlowControlPolicy to legacy API (#​2091)
  • Micro:
FIXED
  • Core NATS:
  • JetStream:
    • Data race in resetOrderedConsumer when resets overlap (#​2111)
    • Avoid panic in PullSubscribe consumer create path. Thanks @​wyf027 for the contribution (#​2088)
    • Honor per-request JSOpt API prefix across JetStream APIs. Thanks @​wyf027 for the contribution (#​2087)
    • Add nil checks for empty JetStream API responses. Thanks @​colecschmidt for the contribution (#​2073)
  • KeyValue:
    • Recognize error code 10164 for replicated KV CAS conflicts (#​2098)
    • Reject keys with consecutive dots in keyValid and searchKeyValid. Thanks @​c-tonneslan for the contribution (#​2076)
  • Micro:
IMPROVED
  • Performance enhancement when publishing core NATS messages with headers. Thanks @​jonchammer for the contribution (#​2083)
  • Migrate tests to ntf (#​2082)
  • Add docs.nats.io examples to main (#​2106)
  • Improve readme wording for JetStream consumers. Thanks @​trevorah for the contribution (#​2104)
Complete Changes

v1.52.0

Compare Source

Changelog

This release focuses on 2.14 nats-server features support.

ADDED
  • JetStream:
    • Added fast batch stream config field (#​2052)
    • Added message scheduling headers and publish opts (#​2051)
    • Updated StreamConfig with Consumer field and added AckFlowControlPolicy (#​2070)
    • Added reset consumer API (#​2069)
FIXED
  • Core NATS:
IMPROVED
  • Fixed Flaky JS cluster tests (#​2062)
Complete Changes

v1.51.0

Compare Source

Changelog

ADDED
  • Core NATS:
    • Option to customize write buffer size (#​2057)
    • Option to automatically reconnect on write error (#​2055)
    • Accessors for JetStream API level and IsSysAccount from ServerInfo (#​2060)
FIXED
  • Core NATS:
    • Make websocket frame validation more robust (#​2050)
  • JetStream:
    • Fix deadlock in Consume() when calling Stop/Drain from ConsumeErrHandler (#​2059)
IMPROVED
  • Fix typos in tests. Thanks @​deining for the contribution (#​2049)
  • Fix deprecation warnings by bumping GH actions to their latest versions. Thanks @​deining for the contibution (#​2048)
  • Code linting: remove functions min and max. Thanks @​deining for the contribution (#​2047)
Complete Changes

v1.50.0

Compare Source

Changelog

FIXED
  • Core NATS:
    • Fix WebSocket close frame discarding buffered data frames (#​2032)
  • JetStream:
    • Remove status listener in Consume()/Messages() cleanup. Thanks @​txuna for the contribution (#​1993)
    • Fix race condition in orderedSubscription.Drain() (#​2030)
    • Fixed OrderedConsumer.Consume() race in handler (#​2043)
IMPROVED
  • Core NATS:
    • De-flake TestAlwaysReconnectOnAccountMaxConnectionsExceededErr (#​2042)
    • Wrap EOF/connection reset errors with TLS context after handshake (#​2031)
  • JetStream:
    • Reject control characters in stream and consumer names (#​2038)
    • Add missing AccountLimits fields in jetstream package (#​2041)
    • Fix flaky TestConsumerPrioritized/messages test (#​2033)
  • KeyValue:
    • Deduplicate keys in KeyValue.Keys() and document ListKeys behavior (#​2029)
    • Fix flaky TestKeyValueWithSources (#​2036)
CHANGED
Complete Changes

v1.49.0

Compare Source

Changelog

ADDED
  • Core NATS:
    • IgnoreDiscoveredServers option for skipping advertised servers (#​2022)
    • Reconnect to selected server callback option #​1958)
    • Set custom server pool (#​1958)
  • KeyValue:
    • Config() method for KeyValueStatus (#​2014)
FIXED
  • Core NATS:
    • Only remove requested status listener (#​1991)
  • JetStream:
    • Cleanup JS Publisher Status Channel (#​1993)
  • Legacy JetStream:
  • Object store:
    • Use default timeout on object Put when context has no deadline (#​2013)
IMPROVED
Complete Changes

v1.48.0

Compare Source

Changelog

ADDED
  • Core NATS:
    • Add publish subject validation and a connection option to skip it (#​1974, #​1979)
  • KeyValue:
    • Enable custom subject transforms on KV sourcing (#​1960)
FIXED
  • JetStream:
    • Fix function pointer check in js.apiRequestWithContext. Thanks @​svenfoo for the contribution (#​1957)
    • Use QueueSubscribe if DeliverGroup is configured on PushConsumer (#​1966)
  • KeyValue:
    • Fix data race when closing watcher updates channel in kv.go (#​1965)
IMPROVED
  • Remove extraneous PullThresholdMessages type definition from README. Thanks @​PeterBParker for the contribution (#​1959)
  • Fix typo in README for service creation method (#​1962)
  • Mention performance implications of using Consumer.Fetch in docs (#​1983)
Complete Changes

v1.47.0

Compare Source

Changelog

ADDED
  • Core NATS:
FIXED
  • Core NATS:
    • Capture async callbacks before pushing on dispatch queue (#​1955)
  • Object Store:
    • Fixed data race when cancelling context while getting object (#​1949)
  • JetStream:
    • Fixed double channel close on simultaneous Stop and Drain (#​1953)
IMPROVED
  • Clarify MessagesContext.Next() doc (#​1951)
Complete Changes

v1.46.1

Compare Source

Changelog

FIXED
  • JetStream:
    • Add omitempty to AllowMsgTTL and AllowMsgCounter (#​1947)
Complete Changes

v1.46.0

Compare Source

Changelog

Overview

This release enables features introduced in nats-server@v2.12.0.

Some features, while enabled in the client by adding relevant configuration, have APIs exposed in synadia-io/orbit.go, namely:

ADDED
  • JetStream:
    • Stream counters configuration option (#​1932, #​1939)
    • New fields in ClusterInfo (#​1935)
    • AllowAtomicPublish stream configuration option (#​1940)
    • PersistMode stream config option for configurable stream persistence settings (#​1943)
    • AllowMsgSchedules stream configuration option to enable message scheduling (#​1942)
    • Context and timeout options to Messages.Next() plus Fetch context support (#​1938)
    • Support custom name prefix for ordered consumers (#​1928)
    • Prioritized priority policy (#​1937)
  • KeyValue:
    • Added KeyValue bucket metadada support (#​1944)
IMPROVED
  • JetStream:
    • Add max consumers limit error (code=10026). Thanks @​Arlet2 for the contribution (#​1922)
    • Return more specific cons info error on ordered consumer recreation (#​1931)
Complete Changes

v1.45.0

Compare Source

Changelog

ADDED
  • Core NATS:
    • Handling for maximum account active connections exceeded (#​1921)
  • JetStream:
    • WithExpectLastSequenceForSubject publish option (#​1920)
FIXED
  • Core NATS:
    • Track delivered count and auto-unsubscribe for channel subscriptions (#​1913)
    • Clear status listeners map on SubscriptionClosed event to prevent race condition (#​1914)
    • Call ReconnectErrHandler for initial connection failures with RetryOnFailedConnect (#​1915)
  • JetStream:
    • CreateOrUpdateStream preserves domain prefix during updates (#​1917)
    • Handle empty response when creating a consumer (#​1912)
IMPROVED
  • KeyValue:
    • Add test checking KV TTL watcher updates (#​1916)
Complete Changes

v1.44.0

Compare Source

Changelog

Overview

This PR adds a PushConsumer implementation to jetstream, allowing easier migration to new API while maintaining usage of push consumers. For now it only supports the callback-based Consume(), more consuming options will be added in future releases.

ADDED
  • Core NATS:
    • UserCredentialBytes() Conn option (#​1877)
  • JetStream:
    • PushConsumer implementation in jetstream package
    • Expose ClientTrace in JetStreamOptions (#​1886)
  • Service API:
    • Expose WithEndpointPendingLimits option (#​1899)
  • Legacy KeyValue:
    • Error() method to KeyLister and KeyWatcher interfaces (#​1889)
FIXED
  • Core NATS:
    • Fix timeoutWriter not recovering after first error (#​1896)
  • JetStream:
    • Consumer.Next() hangs after connection is closed (#​1883)
    • Fixed stream info request for strict mode (#​1887)
    • Ordered consumer not closing on connection close (#​1885)
    • Return a more appropriate error when Subject Transform is not supported (#​1416)
    • Fix subject transform comparison. Thanks @​erikmansson for the contribution (#​1907)
  • Legacy JetStream:
    • Use timeout from JetStreamContext if no deadline is set on ctx (#​1909)
  • KeyValue:
    • Keys() and ListKeys() returning duplicates (#​1884)
    • Fix subject prefix for the Create/Update operation in KV store. Thanks @​SalvaChiLlo for the contribution (#​1903)
CHANGED
  • Change DefaultSubPendingMsgsLimit (#​998)
Complete Changes

v1.43.0

Compare Source

Changelog

ADDED
  • Core NATS:
    • Add nc.LocalAddr, similar to nc.ConnectedAddr (#​1877)
FIXED
  • Service API:
    • Fix stopping service not unsubscribing from all endpoints. Thanks @​arunsworld for the contribution (#​1872)
    • Remove fmt.Println from Service.Stop() (#​1880)
  • Legacy KeyValue:
    • Fix possible race setting timer in kv.WatchFiltered (#​1879)
Complete Changes

v1.42.0

Compare Source

Changelog

Overview

This release adds per-key TTL functionality to key-value stores. It adds:

  1. LimitMarkerTTL config option to enable automatic tombstone deletion.
  2. KeyTTL option to kv.Create()
  3. PurgeTTL() option to kv.Purge()
ADDED
  • KeyValue:
    • Added KeyValue per key TTL support and limit markers (#​1864)
Complete Changes

v1.41.2

Compare Source

Changelog

ADDED
  • Core NATS:
    • Add nc.RemoveStatusListener() method (#​1856)
FIXED
  • Legacy JetStream:
    • Fix Fetch and FetchBatch memory leak (#​1856)
  • Legacy KeyValue:
    • Use context in when purging stream in kv.PurgeDeletes() (#​1858)
  • Bump golang.org/x/crypto to fix vulnerability (#​1857)
Complete Changes

v1.41.1

Compare Source

Changelog

FIXED
  • ObjectStore:
    • Use default timeout for ObjectStore.Get when no deadline is set on ctx (#​1850)
IMPROVED
  • Remove golang.org/x/text dependency (#​1849)
Complete Changes

v1.41.0

Compare Source

Changelog

Overview

This release adds consumer priority groups to JetStream, exposing overflow and pinning policies. For more information on consumer priority groups, see ADR-42.

Added
  • JetStream:
    • Consumer priority groups with pinned and overflow policies (#​1826)
    • WithDefaultTimeout option for JetStream API requests (#​1843)
Fixed
  • KeyValue:
    • Ensure timer is stopped when watcher is stopped (#​1838)
  • ObjectStore:
    • Ensure object watcher stop closes the updates channel (#​1844)
  • Core NATS:
    • Data race when reading current status in sub.StatusChanged and nc.StatusChanged (#​1841)
    • Reset channel after closing in ForceReconnect to avoid panic on subsequent ForceReconnect calls (#​1842, #​1846)
Changed
Improved
  • Legacy JetStream:
    • Cancel Fetch and FetchBatch on reconnect (#​1840)
  • JetStream:
    • Invalid default in documentation for OrderedConsumerConfig.InactiveThreshold (#​1845)
  • KeyValue:
    • Stop the watcher before performing the purge operations for PurgeDeletes (#​1839)
Complete Changes

v1.40.1

Compare Source

Changelog

Overview

This release fixes an issue in legacy JetStream Subscribe which did not respect user-set context when creating a consumer.

FIXED
  • Legacy JetStream:
    • Set context from option when creating consumer in js.Subscribe (#​1835)
Complete Changes

v1.40.0

Compare Source

Changelog

Overview

This release focuses on adding support for new features from NATS Server v2.11.0. This includes:

  • Per message TTLs
  • Consumer pause and resume

Batch direct get will be released in orbit. Support for consumer priority groups will be added in the next minor release.

Added
  • JetStream:
    • Pause and resume JetStream consumer. Thanks @​yordis for the contribution (#​1571)
    • Per message TTL option for JetStream publish (#​1825)
    • Timeout option for async publish (#​1819)
  • Service API
    • Support for disabling queue groups at service, group, and endpoint levels (#​1797)
  • Core NATS:
    • ReconnectErrCB for handling failed reconnect attempts in a callback. Thanks @​sschleemilch for the contribution (#​1804)
Fixed
  • JetStream
    • Invalid subscription on ordered consumer in leaderless cluster (#​1808)
    • Ordered consumer not restarting on no responders (#​1827)
    • Avoid ack id collision in PublishAsync (#​1812)
    • Possible panic in Consumer.Fetch (#​1828)
    • Use resp.Error to show NATS error in deleteMsg. Thanks @​imariman for the contribution (#​1822)
  • KeyValue
    • Deadlock when fetching keys from KV while messages are deleted/purged (#​1824)
Changed
  • Bump go version to 1.23 and update dependencies (#​1821)
Complete Changes

v1.39.1

Compare Source

Changelog

Fixed
  • KeyValue:
Improved
  • Remove stale experimental comment in Service API (#​1805)
Complete Changes

v1.39.0

Compare Source

Changelog

Overview

This release bumps the minimal go version in go.mod to 1.22.

Added
  • JetStream:
    • Added PullMaxMessagesWithBytesLimit option for Consume and Messages (#​1789)
    • Added Metadata to OrderedConsumerConfig. Thanks @​mwain for the contribution (#​1737)
    • Added JetStream.Options() and JetStream.Conn() methods to JetStream interface (#​1792)
  • KeyValue:
    • Added ListKeysFiltered for listing keys with multiple filters. Thanks @​somratdutta for the contribution (#​1711)
Fixed
  • JetStream:
    • Fixed invalid heartbeat timer for Consumer.Messages() (#​1786)
  • ObjectStore:
    • Fixed invalid error being returned from DeleteObjectStore (#​1762)
  • WebSockets:
    • Fixed protocol parsing errors with websocket compression and PONGs. Thanks @​rsafonseca for the contribution (#​1790)
  • Core NATS:
    • Protect against possible nil pointer panic (#​1771)
Changed
Improved
  • Fixed typo in JetStream docs. Thanks @​davydog187 for the contribution (#​1758)
  • Improved documentation of JetStream Consume and Messages options (#​1770)
  • Removed obsolete build tags (#​1787)
Complete Changes

v1.38.0

Compare Source

Changelog

Added
  • Core NATS:
    • Added UserInfoHandler for dynamically setting user/password (#​1713)
    • Added PermissionErrOnSubscribe option, causing SubscribeSync to return nats.ErrPermissionViolation on NextMsg() if there was a permission error (#​1728)
    • Added Msgs() method on Subscription, returning an iterator (iter.Seq2[*nats.Msg, error]) for the subscription. This method is only available for go version >=1.23 (#​1728)
  • KeyValue:
  • Added WatchFiltered method to watch for updates with multiple filters (#​1739)
Fixed
  • Core NATS:
  • JetStream:
    • Fixed PublishAsync not closing done and stall channels after failed retries (#​1719)
    • Set valid fetch sequence in ordered consumer's Fetch() and Next() after timeout (#​1705)
    • Do not overwrite ordered consumer deliver policy if start time is set (#​1742)
    • Fixed race condition in MessageBatch (#​1743)
  • Legacy JetStream:
    • Fixed race condition in MessageBatch (#​1743)
Changed
  • Legacy Jetstream:
Improved
Complete Changes

Configuration

📅 Schedule: (UTC)

  • Branch creation
    • At any time (no schedule defined)
  • Automerge
    • At any time (no schedule defined)

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR has been generated by Mend Renovate CLI.

This PR contains the following updates: | Package | Change | [Age](https://docs.renovatebot.com/merge-confidence/) | [Confidence](https://docs.renovatebot.com/merge-confidence/) | |---|---|---|---| | [github.com/nats-io/nats.go](https://github.com/nats-io/nats.go) | `v1.37.0` → `v1.55.0` | ![age](https://developer.mend.io/api/mc/badges/age/go/github.com%2fnats-io%2fnats.go/v1.55.0?slim=true) | ![confidence](https://developer.mend.io/api/mc/badges/confidence/go/github.com%2fnats-io%2fnats.go/v1.37.0/v1.55.0?slim=true) | --- ### Release Notes <details> <summary>nats-io/nats.go (github.com/nats-io/nats.go)</summary> ### [`v1.55.0`](https://github.com/nats-io/nats.go/releases/tag/v1.55.0) [Compare Source](https://github.com/nats-io/nats.go/compare/v1.54.0...v1.55.0) #### Changelog This is the biggest nats.go release in a long time: 47 changes with more than half of them coming from 18 external contributors - thank you all! Most of this release is a robustness effort. Nearly 30 bug fixes address deadlocks, goroutine and timer leaks, data races and stalls in reconnect and drain handling, pull and ordered consumers, async publish and service API. It also adds the `FetchMaxBytes()` option and `Conn.RemoteAccount()`. ##### ADDED - Core NATS: - `Conn.RemoteAccount()` and `ServerInfo.RemoteAccount` exposing the account the client is bound to ([#&#8203;2156](https://github.com/nats-io/nats.go/issues/2156)) - JetStream: - `FetchMaxBytes()` option to limit both the number of messages and total bytes in a single `Fetch()` request. Thanks [@&#8203;manenim](https://github.com/manenim) for the contribution ([#&#8203;2198](https://github.com/nats-io/nats.go/issues/2198)) - `StreamInfo.Domain`, `StreamInfo.Alternates`, `StreamState.Lost`, `StreamSourceInfo.External` and `StreamSourceInfo.Error` in stream info ([#&#8203;2168](https://github.com/nats-io/nats.go/issues/2168)) - `ErrStreamMessageExceedsMaximum` for JetStream error code 10054, returned when a message exceeds the stream's `MaxMsgSize`. Thanks [@&#8203;matehsan](https://github.com/matehsan) for the contribution ([#&#8203;2110](https://github.com/nats-io/nats.go/issues/2110)) ##### FIXED - Core NATS: - `ForceReconnect()` called while already reconnecting disabling `ReconnectWait` and custom reconnect delays, so the client dialed in a tight loop. Thanks [@&#8203;Arsen302](https://github.com/Arsen302) for the contribution and [@&#8203;MokiMeow](https://github.com/MokiMeow) for the diagnosis and test ([#&#8203;2179](https://github.com/nats-io/nats.go/issues/2179)) - Connection closing for good instead of reconnecting after a partial write left a truncated message on the wire ([#&#8203;2169](https://github.com/nats-io/nats.go/issues/2169)) - Connection status listeners losing an unread event and being unregistered when the next status was sent ([#&#8203;2193](https://github.com/nats-io/nats.go/issues/2193)) - Message headers not counted against subscription pending byte limits, so header-heavy subscriptions could exceed the limit without reporting a slow consumer. Thanks [@&#8203;Grivn](https://github.com/Grivn) for the contribution ([#&#8203;2200](https://github.com/nats-io/nats.go/issues/2200)) - Requests interrupted by a reconnect returning `ErrConnectionClosed` instead of `ErrDisconnected`. Thanks [@&#8203;AshSgDe29071999](https://github.com/AshSgDe29071999) for the contribution ([#&#8203;2129](https://github.com/nats-io/nats.go/issues/2129)) - Default port added to the path instead of the host for server URLs with a path and no port, e.g. `ws://host/nats`. Thanks [@&#8203;dannyshafer](https://github.com/dannyshafer) for the contribution ([#&#8203;2177](https://github.com/nats-io/nats.go/issues/2177)) - `Close()` during `Drain()` flipping the closed connection back to `DRAINING_PUBS` and flushing on it. Thanks [@&#8203;Kshot3000](https://github.com/Kshot3000) for the contribution ([#&#8203;2163](https://github.com/nats-io/nats.go/issues/2163)) - `Drain()` waiting for the full `DrainTimeout` when the connection was closed mid-drain ([#&#8203;2171](https://github.com/nats-io/nats.go/issues/2171)) - `IsSystemAccount()` reset to false by async INFO updates, such as cluster topology changes or lame duck mode ([#&#8203;2156](https://github.com/nats-io/nats.go/issues/2156)) - JetStream: - Pull consumer `Consume()` and `Messages()` deadlocking on `Stop()` or `Drain()` while buffered messages were still being delivered. Thanks [@&#8203;clwluvw](https://github.com/clwluvw) for the contribution ([#&#8203;2165](https://github.com/nats-io/nats.go/issues/2165)) - `Messages()` iterator goroutines leaking after the connection is closed. Thanks [@&#8203;clwluvw](https://github.com/clwluvw) for the contribution ([#&#8203;2166](https://github.com/nats-io/nats.go/issues/2166)) - Heartbeat timer and status listener left running when `Consume()` ends because the connection was closed. Thanks [@&#8203;clwluvw](https://github.com/clwluvw) for the contribution ([#&#8203;2164](https://github.com/nats-io/nats.go/issues/2164)) - `Messages()` iterator returning `ErrMsgIteratorClosed` instead of the remaining buffered messages when `Next()` raced with `Drain()` ([#&#8203;2188](https://github.com/nats-io/nats.go/issues/2188)) - Pull consumer with `StopAfter` stalling until the missed heartbeat check (30s by default) after a pull expired. Thanks [@&#8203;huynguyen7](https://github.com/huynguyen7) for the contribution ([#&#8203;2208](https://github.com/nats-io/nats.go/issues/2208)) - Ordered consumer with `StopAfter` hanging on `Stop()`/`Drain()`, delivering too many or too few messages, or panicking after a consumer reset. Thanks [@&#8203;clwluvw](https://github.com/clwluvw) for the contribution ([#&#8203;2167](https://github.com/nats-io/nats.go/issues/2167)) - Ordered consumer `Fetch()`, `Next()` and `FetchBytes()` blocking forever after returning `ErrOrderedConsumerConcurrentRequests`, and `FetchNoWait()` restarting from the beginning of the stream ([#&#8203;2211](https://github.com/nats-io/nats.go/issues/2211)) - Ordered consumer `Consume()` and `Messages()` using the 15s pull consumer heartbeat instead of the 5s ordered default, so a stalled consumer was reset after \~30s instead of \~10s. Thanks [@&#8203;arminazimi](https://github.com/arminazimi) for the contribution ([#&#8203;2182](https://github.com/nats-io/nats.go/issues/2182)) - `PublishAsync()` exceeding `WithPublishAsyncMaxPending()` under concurrent calls. Thanks [@&#8203;ShravanthReddy](https://github.com/ShravanthReddy) for the contribution ([#&#8203;2126](https://github.com/nats-io/nats.go/issues/2126)) - Async publish error callbacks for messages pending during a reconnect delayed until the publisher shut down. Thanks [@&#8203;H-XX-D](https://github.com/H-XX-D) for the contribution ([#&#8203;2150](https://github.com/nats-io/nats.go/issues/2150)) - Data race between `Info()` and `CachedInfo()` on streams and consumers. Thanks [@&#8203;vulragrag-star](https://github.com/vulragrag-star) for the contribution ([#&#8203;2152](https://github.com/nats-io/nats.go/issues/2152)) - Reusing the same `KeyValueConfig.Sources` for several KeyValue buckets carrying the first bucket's subject transform into the next ones, so their reads returned `ErrKeyNotFound`. Thanks [@&#8203;zhechen-cs](https://github.com/zhechen-cs) for the contribution ([#&#8203;2190](https://github.com/nats-io/nats.go/issues/2190)) - Object Store `GetFile()` leaving trailing bytes of an existing destination file when downloading a shorter object. Thanks [@&#8203;zhechen-cs](https://github.com/zhechen-cs) for the contribution ([#&#8203;2197](https://github.com/nats-io/nats.go/issues/2197)) - Legacy JetStream: - Async publish error callbacks for messages pending during a reconnect delayed until the publisher shut down. Thanks [@&#8203;H-XX-D](https://github.com/H-XX-D) for the contribution ([#&#8203;2150](https://github.com/nats-io/nats.go/issues/2150)) - KeyValue `Create()` and `Update()` on a cross-domain mirrored bucket failing with `nats: no response from stream`. Thanks [@&#8203;spicysharkco](https://github.com/spicysharkco) for the contribution ([#&#8203;2203](https://github.com/nats-io/nats.go/issues/2203)) - Object Store `GetFile()` leaving trailing bytes of an existing destination file when downloading a shorter object. Thanks [@&#8203;zhechen-cs](https://github.com/zhechen-cs) for the contribution ([#&#8203;2197](https://github.com/nats-io/nats.go/issues/2197)) - Service API: - Panic in `AddService()` on a closed connection ([#&#8203;2154](https://github.com/nats-io/nats.go/issues/2154)) - Panic with `send on closed channel` when callbacks were queued during `Stop()` ([#&#8203;2173](https://github.com/nats-io/nats.go/issues/2173)) - Service stopping on async errors from unrelated subscriptions with overlapping subjects. Async errors are now matched by subscription, recorded in endpoint stats and passed to `ErrorHandler`, and only a closed connection stops the service ([#&#8203;2174](https://github.com/nats-io/nats.go/issues/2174)) - Stopping one service detaching the other services on the same connection from async errors and connection close ([#&#8203;2178](https://github.com/nats-io/nats.go/issues/2178)) - Service and endpoint metadata changing after it was set, when the application modified the maps passed to or returned by the service ([#&#8203;2194](https://github.com/nats-io/nats.go/issues/2194)) - `Reset()` clearing the endpoint queue group reported in stats ([#&#8203;2195](https://github.com/nats-io/nats.go/issues/2195)) ##### IMPROVED - Core NATS: - Report `Maximum Control Line Exceeded` to the async error handler before closing the connection. Thanks [@&#8203;kave08](https://github.com/kave08) for the contribution ([#&#8203;2184](https://github.com/nats-io/nats.go/issues/2184)) - Avoid extra allocations in `DecodeHeadersMsg`. Thanks [@&#8203;0xAozora](https://github.com/0xAozora) for the contribution ([#&#8203;2132](https://github.com/nats-io/nats.go/issues/2132)) - Compute header size in `Msg.Size()` without serializing headers. Thanks [@&#8203;0xAozora](https://github.com/0xAozora) for the contribution ([#&#8203;2125](https://github.com/nats-io/nats.go/issues/2125)) - Document that `Subscription` is safe for concurrent use and that `Msg` is not reused after delivery. Thanks [@&#8203;kave08](https://github.com/kave08) for the contributions ([#&#8203;2183](https://github.com/nats-io/nats.go/issues/2183), [#&#8203;2204](https://github.com/nats-io/nats.go/issues/2204)) - JetStream: - Avoid heap allocation of publish options when publishing without options. Thanks [@&#8203;0xAozora](https://github.com/0xAozora) for the contribution ([#&#8203;2124](https://github.com/nats-io/nats.go/issues/2124)) - Avoid per-message metadata allocations in `Fetch()`, ordered consumers and Object Store `Watch()` ([#&#8203;2212](https://github.com/nats-io/nats.go/issues/2212)) - Legacy JetStream: - Avoid per-message metadata allocations in Object Store `Watch()` ([#&#8203;2212](https://github.com/nats-io/nats.go/issues/2212)) - Document the default `MaxAckPending` for subscriptions that create their own consumer ([#&#8203;2213](https://github.com/nats-io/nats.go/issues/2213)) - Tests handle v2 ack subjects, which nats-server main now sends by default ([#&#8203;2192](https://github.com/nats-io/nats.go/issues/2192), [#&#8203;2186](https://github.com/nats-io/nats.go/issues/2186)) - Fix ordered consumer test exceeding 1000 consumers ([#&#8203;2155](https://github.com/nats-io/nats.go/issues/2155)) and bump the tester to fix intermittent server config parse errors ([#&#8203;2170](https://github.com/nats-io/nats.go/issues/2170)) ##### Complete Changes ### [`v1.54.0`](https://github.com/nats-io/nats.go/releases/tag/v1.54.0) [Compare Source](https://github.com/nats-io/nats.go/compare/v1.53.1...v1.54.0) #### Changelog This release raises the minimum supported Go version to 1.26 and adds support for nats-server v2.15 stream and consumer info fields. ##### ADDED - Core NATS: - `nats.MultipathTCP()` option to enable or disable MPTCP for outbound connections ([#&#8203;2145](https://github.com/nats-io/nats.go/issues/2145)) - `Conn.ConnectedDomain()` to read the JetStream domain advertised by the connected server ([#&#8203;2139](https://github.com/nats-io/nats.go/issues/2139)) - JetStream: - `ClusterInfo.Desired`, `PeerInfo.Peer`, `PeerInfo.Pending` and `StreamSourceInfo.Seq` in stream and consumer info, reported by nats-server v2.15 ([#&#8203;2144](https://github.com/nats-io/nats.go/issues/2144)) - `Nats-Schedule-Rollup` header const and `WithScheduleRollup()` publish option ([#&#8203;2142](https://github.com/nats-io/nats.go/issues/2142)) ##### FIXED - Core NATS: - Panic in `DecodeHeadersMsg` on inline status tokens shorter than 3 characters. Thanks [@&#8203;nikitha-m](https://github.com/nikitha-m) for the contribution ([#&#8203;2101](https://github.com/nats-io/nats.go/issues/2101)) - Data race on `Subscription.sid` between `applyNewSID` and `removeSub` ([#&#8203;2122](https://github.com/nats-io/nats.go/issues/2122)) - JetStream: - `Messages()` iterator going silent after a reconnect that completes between `Next()` calls. Thanks [@&#8203;1995parham](https://github.com/1995parham) for the contribution ([#&#8203;2135](https://github.com/nats-io/nats.go/issues/2135)) - Legacy ordered consumer silently losing messages when the subscription hits its pending limits ([#&#8203;2137](https://github.com/nats-io/nats.go/issues/2137)) - Legacy ordered consumer reset resurrecting an unsubscribed or draining subscription ([#&#8203;2133](https://github.com/nats-io/nats.go/issues/2133)) ##### IMPROVED - Core NATS: - Avoid allocation when parsing header message arguments with a fifth token. Thanks [@&#8203;0xAozora](https://github.com/0xAozora) for the contribution ([#&#8203;2130](https://github.com/nats-io/nats.go/issues/2130)) - Preallocate reply subject buffers. Thanks [@&#8203;0xAozora](https://github.com/0xAozora) for the contribution ([#&#8203;2123](https://github.com/nats-io/nats.go/issues/2123)) - JetStream: - Prevent `doErr` closure escaping to the heap in async publish reply handling. Thanks [@&#8203;0xAozora](https://github.com/0xAozora) for the contribution ([#&#8203;2127](https://github.com/nats-io/nats.go/issues/2127)) - Fix typo in `Publisher` interface methods comment. Thanks [@&#8203;sreeram77](https://github.com/sreeram77) for the contribution ([#&#8203;2120](https://github.com/nats-io/nats.go/issues/2120)) - Minimum Go version is now 1.26 ([#&#8203;2146](https://github.com/nats-io/nats.go/issues/2146)) - Bump `klauspost/compress` to v1.20.0 and `nkeys` to v0.4.16 ([#&#8203;2117](https://github.com/nats-io/nats.go/issues/2117), [#&#8203;2146](https://github.com/nats-io/nats.go/issues/2146)) - Tests run locally without docker via an in-process ntf tester ([#&#8203;2131](https://github.com/nats-io/nats.go/issues/2131)), and CI now runs against nats-server v2.15.0 ([#&#8203;2146](https://github.com/nats-io/nats.go/issues/2146)) - Fix flaky cluster restart tests ([#&#8203;2141](https://github.com/nats-io/nats.go/issues/2141)) and list consumers test against latest server ([#&#8203;2138](https://github.com/nats-io/nats.go/issues/2138)) ##### Complete Changes ### [`v1.53.1`](https://github.com/nats-io/nats.go/releases/tag/v1.53.1) [Compare Source](https://github.com/nats-io/nats.go/compare/v1.53.0...v1.53.1) #### Changelog This is a patch release containing no functional changes. ##### FIXED - `Version` const and the README install line, which were not updated for v1.53.0 ([#&#8203;2118](https://github.com/nats-io/nats.go/issues/2118)) ##### Complete Changes ### [`v1.53.0`](https://github.com/nats-io/nats.go/releases/tag/v1.53.0) [Compare Source](https://github.com/nats-io/nats.go/compare/v1.52.0...v1.53.0) #### Changelog ##### ADDED - JetStream: - `WithPublishAsyncAckHandler` option for JetStream async publish. Thanks [@&#8203;occamist](https://github.com/occamist) for the contribution ([#&#8203;2109](https://github.com/nats-io/nats.go/issues/2109)) - `AckFlowControlPolicy` to legacy API ([#&#8203;2091](https://github.com/nats-io/nats.go/issues/2091)) - Micro: - `micro.WithEndpointMetadataKey`. Thanks [@&#8203;joeriddles](https://github.com/joeriddles) for the contribution ([#&#8203;2079](https://github.com/nats-io/nats.go/issues/2079)) ##### FIXED - Core NATS: - Websocket connection with path. Thanks [@&#8203;joeriddles](https://github.com/joeriddles) for the contribution ([#&#8203;2092](https://github.com/nats-io/nats.go/issues/2092)) - `MsgsTimeout` iterator yielding a spurious `(nil, nil)` after a timeout. Thanks [@&#8203;sueun-dev](https://github.com/sueun-dev) and [@&#8203;c-tonneslan](https://github.com/c-tonneslan) for the contributions ([#&#8203;2099](https://github.com/nats-io/nats.go/issues/2099), [#&#8203;2093](https://github.com/nats-io/nats.go/issues/2093)) - JetStream: - Data race in `resetOrderedConsumer` when resets overlap ([#&#8203;2111](https://github.com/nats-io/nats.go/issues/2111)) - Avoid panic in `PullSubscribe` consumer create path. Thanks [@&#8203;wyf027](https://github.com/wyf027) for the contribution ([#&#8203;2088](https://github.com/nats-io/nats.go/issues/2088)) - Honor per-request `JSOpt` API prefix across JetStream APIs. Thanks [@&#8203;wyf027](https://github.com/wyf027) for the contribution ([#&#8203;2087](https://github.com/nats-io/nats.go/issues/2087)) - Add nil checks for empty JetStream API responses. Thanks [@&#8203;colecschmidt](https://github.com/colecschmidt) for the contribution ([#&#8203;2073](https://github.com/nats-io/nats.go/issues/2073)) - KeyValue: - Recognize error code 10164 for replicated KV CAS conflicts ([#&#8203;2098](https://github.com/nats-io/nats.go/issues/2098)) - Reject keys with consecutive dots in `keyValid` and `searchKeyValid`. Thanks [@&#8203;c-tonneslan](https://github.com/c-tonneslan) for the contribution ([#&#8203;2076](https://github.com/nats-io/nats.go/issues/2076)) - Micro: - Endpoint subject prefix over-match. Thanks [@&#8203;vsaraikin](https://github.com/vsaraikin) for the contribution ([#&#8203;2105](https://github.com/nats-io/nats.go/issues/2105)) ##### IMPROVED - Performance enhancement when publishing core NATS messages with headers. Thanks [@&#8203;jonchammer](https://github.com/jonchammer) for the contribution ([#&#8203;2083](https://github.com/nats-io/nats.go/issues/2083)) - Migrate tests to ntf ([#&#8203;2082](https://github.com/nats-io/nats.go/issues/2082)) - Add docs.nats.io examples to main ([#&#8203;2106](https://github.com/nats-io/nats.go/issues/2106)) - Improve readme wording for JetStream consumers. Thanks [@&#8203;trevorah](https://github.com/trevorah) for the contribution ([#&#8203;2104](https://github.com/nats-io/nats.go/issues/2104)) ##### Complete Changes ### [`v1.52.0`](https://github.com/nats-io/nats.go/releases/tag/v1.52.0) [Compare Source](https://github.com/nats-io/nats.go/compare/v1.51.0...v1.52.0) #### Changelog This release focuses on 2.14 nats-server features support. ##### ADDED - JetStream: - Added fast batch stream config field ([#&#8203;2052](https://github.com/nats-io/nats.go/issues/2052)) - Added message scheduling headers and publish opts ([#&#8203;2051](https://github.com/nats-io/nats.go/issues/2051)) - Updated `StreamConfig` with `Consumer` field and added `AckFlowControlPolicy` ([#&#8203;2070](https://github.com/nats-io/nats.go/issues/2070)) - Added reset consumer API ([#&#8203;2069](https://github.com/nats-io/nats.go/issues/2069)) ##### FIXED - Core NATS: - Fix Subscription.StatusChanged channel closure on Closed Subscription. Thanks [@&#8203;nithimani38-prog](https://github.com/nithimani38-prog) for the contribution ([#&#8203;2034](https://github.com/nats-io/nats.go/issues/2034)) ##### IMPROVED - Fixed Flaky JS cluster tests ([#&#8203;2062](https://github.com/nats-io/nats.go/issues/2062)) ##### Complete Changes ### [`v1.51.0`](https://github.com/nats-io/nats.go/releases/tag/v1.51.0) [Compare Source](https://github.com/nats-io/nats.go/compare/v1.50.0...v1.51.0) #### Changelog ##### ADDED - Core NATS: - Option to customize write buffer size ([#&#8203;2057](https://github.com/nats-io/nats.go/issues/2057)) - Option to automatically reconnect on write error ([#&#8203;2055](https://github.com/nats-io/nats.go/issues/2055)) - Accessors for JetStream API level and `IsSysAccount` from `ServerInfo` ([#&#8203;2060](https://github.com/nats-io/nats.go/issues/2060)) ##### FIXED - Core NATS: - Make websocket frame validation more robust ([#&#8203;2050](https://github.com/nats-io/nats.go/issues/2050)) - JetStream: - Fix deadlock in `Consume()` when calling `Stop`/`Drain` from `ConsumeErrHandler` ([#&#8203;2059](https://github.com/nats-io/nats.go/issues/2059)) ##### IMPROVED - Fix typos in tests. Thanks [@&#8203;deining](https://github.com/deining) for the contribution ([#&#8203;2049](https://github.com/nats-io/nats.go/issues/2049)) - Fix deprecation warnings by bumping GH actions to their latest versions. Thanks [@&#8203;deining](https://github.com/deining) for the contibution ([#&#8203;2048](https://github.com/nats-io/nats.go/issues/2048)) - Code linting: remove functions min and max. Thanks [@&#8203;deining](https://github.com/deining) for the contribution ([#&#8203;2047](https://github.com/nats-io/nats.go/issues/2047)) ##### Complete Changes ### [`v1.50.0`](https://github.com/nats-io/nats.go/releases/tag/v1.50.0) [Compare Source](https://github.com/nats-io/nats.go/compare/v1.49.0...v1.50.0) #### Changelog ##### FIXED - Core NATS: - Fix WebSocket close frame discarding buffered data frames ([#&#8203;2032](https://github.com/nats-io/nats.go/issues/2032)) - JetStream: - Remove status listener in Consume()/Messages() cleanup. Thanks [@&#8203;txuna](https://github.com/txuna) for the contribution ([#&#8203;1993](https://github.com/nats-io/nats.go/issues/1993)) - Fix race condition in `orderedSubscription.Drain()` ([#&#8203;2030](https://github.com/nats-io/nats.go/issues/2030)) - Fixed `OrderedConsumer.Consume()` race in handler ([#&#8203;2043](https://github.com/nats-io/nats.go/issues/2043)) ##### IMPROVED - Core NATS: - De-flake TestAlwaysReconnectOnAccountMaxConnectionsExceededErr ([#&#8203;2042](https://github.com/nats-io/nats.go/issues/2042)) - Wrap EOF/connection reset errors with TLS context after handshake ([#&#8203;2031](https://github.com/nats-io/nats.go/issues/2031)) - JetStream: - Reject control characters in stream and consumer names ([#&#8203;2038](https://github.com/nats-io/nats.go/issues/2038)) - Add missing `AccountLimits` fields in `jetstream` package ([#&#8203;2041](https://github.com/nats-io/nats.go/issues/2041)) - Fix flaky TestConsumerPrioritized/messages test ([#&#8203;2033](https://github.com/nats-io/nats.go/issues/2033)) - KeyValue: - Deduplicate keys in KeyValue.Keys() and document ListKeys behavior ([#&#8203;2029](https://github.com/nats-io/nats.go/issues/2029)) - Fix flaky TestKeyValueWithSources ([#&#8203;2036](https://github.com/nats-io/nats.go/issues/2036)) ##### CHANGED - Bump go version to 1.25 and update dependencies ([#&#8203;2044](https://github.com/nats-io/nats.go/issues/2044), [#&#8203;2039](https://github.com/nats-io/nats.go/issues/2039)) ##### Complete Changes ### [`v1.49.0`](https://github.com/nats-io/nats.go/releases/tag/v1.49.0) [Compare Source](https://github.com/nats-io/nats.go/compare/v1.48.0...v1.49.0) #### Changelog ##### ADDED - Core NATS: - `IgnoreDiscoveredServers` option for skipping advertised servers ([#&#8203;2022](https://github.com/nats-io/nats.go/issues/2022)) - Reconnect to selected server callback option [#&#8203;1958](https://github.com/nats-io/nats.go/issues/1958)) - Set custom server pool ([#&#8203;1958](https://github.com/nats-io/nats.go/issues/1958)) - KeyValue: - `Config()` method for `KeyValueStatus` ([#&#8203;2014](https://github.com/nats-io/nats.go/issues/2014)) ##### FIXED - Core NATS: - Only remove requested status listener ([#&#8203;1991](https://github.com/nats-io/nats.go/issues/1991)) - JetStream: - Cleanup JS Publisher Status Channel ([#&#8203;1993](https://github.com/nats-io/nats.go/issues/1993)) - Legacy JetStream: - Fix nil pointer dereference in `ConsumerInfo`. Thanks [@&#8203;olde-ducke](https://github.com/olde-ducke) for the contribution ([#&#8203;1987](https://github.com/nats-io/nats.go/issues/1987)) - Object store: - Use default timeout on object `Put` when context has no deadline ([#&#8203;2013](https://github.com/nats-io/nats.go/issues/2013)) ##### IMPROVED - Various docs and test improvements across the codebase. Thanks [@&#8203;jjpinto](https://github.com/jjpinto) for the contribution! ([#&#8203;1995](https://github.com/nats-io/nats.go/issues/1995), [#&#8203;1996](https://github.com/nats-io/nats.go/issues/1996), [#&#8203;1997](https://github.com/nats-io/nats.go/issues/1997), [#&#8203;1998](https://github.com/nats-io/nats.go/issues/1998), [#&#8203;1999](https://github.com/nats-io/nats.go/issues/1999), [#&#8203;2000](https://github.com/nats-io/nats.go/issues/2000), [#&#8203;2001](https://github.com/nats-io/nats.go/issues/2001), [#&#8203;2002](https://github.com/nats-io/nats.go/issues/2002), [#&#8203;2003](https://github.com/nats-io/nats.go/issues/2003), [#&#8203;2004](https://github.com/nats-io/nats.go/issues/2004), [#&#8203;2005](https://github.com/nats-io/nats.go/issues/2005), [#&#8203;2007](https://github.com/nats-io/nats.go/issues/2007), [#&#8203;2008](https://github.com/nats-io/nats.go/issues/2008), [#&#8203;2009](https://github.com/nats-io/nats.go/issues/2009), [#&#8203;2010](https://github.com/nats-io/nats.go/issues/2010), [#&#8203;2011](https://github.com/nats-io/nats.go/issues/2011), [#&#8203;2012](https://github.com/nats-io/nats.go/issues/2012), [#&#8203;2016](https://github.com/nats-io/nats.go/issues/2016), [#&#8203;2017](https://github.com/nats-io/nats.go/issues/2017), [#&#8203;2018](https://github.com/nats-io/nats.go/issues/2018), [#&#8203;2019](https://github.com/nats-io/nats.go/issues/2019), [#&#8203;2020](https://github.com/nats-io/nats.go/issues/2020)) - Add JetStream migration guide ([#&#8203;2023](https://github.com/nats-io/nats.go/issues/2023)) ##### Complete Changes ### [`v1.48.0`](https://github.com/nats-io/nats.go/releases/tag/v1.48.0) [Compare Source](https://github.com/nats-io/nats.go/compare/v1.47.0...v1.48.0) #### Changelog ##### ADDED - Core NATS: - Add publish subject validation and a connection option to skip it ([#&#8203;1974](https://github.com/nats-io/nats.go/issues/1974), [#&#8203;1979](https://github.com/nats-io/nats.go/issues/1979)) - KeyValue: - Enable custom subject transforms on KV sourcing ([#&#8203;1960](https://github.com/nats-io/nats.go/issues/1960)) ##### FIXED - JetStream: - Fix function pointer check in `js.apiRequestWithContext`. Thanks [@&#8203;svenfoo](https://github.com/svenfoo) for the contribution ([#&#8203;1957](https://github.com/nats-io/nats.go/issues/1957)) - Use QueueSubscribe if DeliverGroup is configured on PushConsumer ([#&#8203;1966](https://github.com/nats-io/nats.go/issues/1966)) - KeyValue: - Fix data race when closing watcher updates channel in kv.go ([#&#8203;1965](https://github.com/nats-io/nats.go/issues/1965)) ##### IMPROVED - Remove extraneous PullThresholdMessages type definition from README. Thanks [@&#8203;PeterBParker](https://github.com/PeterBParker) for the contribution ([#&#8203;1959](https://github.com/nats-io/nats.go/issues/1959)) - Fix typo in README for service creation method ([#&#8203;1962](https://github.com/nats-io/nats.go/issues/1962)) - Mention performance implications of using Consumer.Fetch in docs ([#&#8203;1983](https://github.com/nats-io/nats.go/issues/1983)) ##### Complete Changes ### [`v1.47.0`](https://github.com/nats-io/nats.go/releases/tag/v1.47.0) [Compare Source](https://github.com/nats-io/nats.go/compare/v1.46.1...v1.47.0) #### Changelog ##### ADDED - Core NATS: - Support sending custom WebSocket headers on connect. Thanks [@&#8203;saurabhojha](https://github.com/saurabhojha) for the contribution ([#&#8203;1919](https://github.com/nats-io/nats.go/issues/1919)) ##### FIXED - Core NATS: - Capture async callbacks before pushing on dispatch queue ([#&#8203;1955](https://github.com/nats-io/nats.go/issues/1955)) - Object Store: - Fixed data race when cancelling context while getting object ([#&#8203;1949](https://github.com/nats-io/nats.go/issues/1949)) - JetStream: - Fixed double channel close on simultaneous Stop and Drain ([#&#8203;1953](https://github.com/nats-io/nats.go/issues/1953)) ##### IMPROVED - Clarify `MessagesContext.Next()` doc ([#&#8203;1951](https://github.com/nats-io/nats.go/issues/1951)) ##### Complete Changes ### [`v1.46.1`](https://github.com/nats-io/nats.go/releases/tag/v1.46.1) [Compare Source](https://github.com/nats-io/nats.go/compare/v1.46.0...v1.46.1) #### Changelog ##### FIXED - JetStream: - Add omitempty to AllowMsgTTL and AllowMsgCounter ([#&#8203;1947](https://github.com/nats-io/nats.go/issues/1947)) ##### Complete Changes ### [`v1.46.0`](https://github.com/nats-io/nats.go/releases/tag/v1.46.0) [Compare Source](https://github.com/nats-io/nats.go/compare/v1.45.0...v1.46.0) #### Changelog ##### Overview This release enables features introduced in [nats-server@v2.12.0](https://github.com/nats-io/nats-server/releases/tag/v2.12.0). Some features, while enabled in the client by adding relevant configuration, have APIs exposed in [synadia-io/orbit.go](https://github.com/synadia-io/orbit.go), namely: - [Distributed Counters](https://github.com/synadia-io/orbit.go/blob/main/counters/README.md) - [Atomic batch publish](https://github.com/synadia-io/orbit.go/blob/main/jetstreamext/README.md#atomic-batch-publishing) ##### ADDED - JetStream: - Stream counters configuration option ([#&#8203;1932](https://github.com/nats-io/nats.go/issues/1932), [#&#8203;1939](https://github.com/nats-io/nats.go/issues/1939)) - New fields in `ClusterInfo` ([#&#8203;1935](https://github.com/nats-io/nats.go/issues/1935)) - `AllowAtomicPublish` stream configuration option ([#&#8203;1940](https://github.com/nats-io/nats.go/issues/1940)) - `PersistMode` stream config option for configurable stream persistence settings ([#&#8203;1943](https://github.com/nats-io/nats.go/issues/1943)) - `AllowMsgSchedules` stream configuration option to enable message scheduling ([#&#8203;1942](https://github.com/nats-io/nats.go/issues/1942)) - Context and timeout options to `Messages.Next()` plus `Fetch` context support ([#&#8203;1938](https://github.com/nats-io/nats.go/issues/1938)) - Support custom name prefix for ordered consumers ([#&#8203;1928](https://github.com/nats-io/nats.go/issues/1928)) - Prioritized priority policy ([#&#8203;1937](https://github.com/nats-io/nats.go/issues/1937)) - KeyValue: - Added KeyValue bucket metadada support ([#&#8203;1944](https://github.com/nats-io/nats.go/issues/1944)) ##### IMPROVED - JetStream: - Add max consumers limit error (code=10026). Thanks [@&#8203;Arlet2](https://github.com/Arlet2) for the contribution ([#&#8203;1922](https://github.com/nats-io/nats.go/issues/1922)) - Return more specific cons info error on ordered consumer recreation ([#&#8203;1931](https://github.com/nats-io/nats.go/issues/1931)) ##### Complete Changes ### [`v1.45.0`](https://github.com/nats-io/nats.go/releases/tag/v1.45.0) [Compare Source](https://github.com/nats-io/nats.go/compare/v1.44.0...v1.45.0) #### Changelog ##### ADDED - Core NATS: - Handling for maximum account active connections exceeded ([#&#8203;1921](https://github.com/nats-io/nats.go/issues/1921)) - JetStream: - `WithExpectLastSequenceForSubject` publish option ([#&#8203;1920](https://github.com/nats-io/nats.go/issues/1920)) ##### FIXED - Core NATS: - Track delivered count and auto-unsubscribe for channel subscriptions ([#&#8203;1913](https://github.com/nats-io/nats.go/issues/1913)) - Clear status listeners map on `SubscriptionClosed` event to prevent race condition ([#&#8203;1914](https://github.com/nats-io/nats.go/issues/1914)) - Call `ReconnectErrHandler` for initial connection failures with `RetryOnFailedConnect` ([#&#8203;1915](https://github.com/nats-io/nats.go/issues/1915)) - JetStream: - `CreateOrUpdateStream` preserves domain prefix during updates ([#&#8203;1917](https://github.com/nats-io/nats.go/issues/1917)) - Handle empty response when creating a consumer ([#&#8203;1912](https://github.com/nats-io/nats.go/issues/1912)) ##### IMPROVED - KeyValue: - Add test checking KV TTL watcher updates ([#&#8203;1916](https://github.com/nats-io/nats.go/issues/1916)) ##### Complete Changes ### [`v1.44.0`](https://github.com/nats-io/nats.go/releases/tag/v1.44.0) [Compare Source](https://github.com/nats-io/nats.go/compare/v1.43.0...v1.44.0) #### Changelog #### Overview This PR adds a `PushConsumer` implementation to `jetstream`, allowing easier migration to new API while maintaining usage of push consumers. For now it only supports the callback-based `Consume()`, more consuming options will be added in future releases. ##### ADDED - Core NATS: - `UserCredentialBytes()` `Conn` option ([#&#8203;1877](https://github.com/nats-io/nats.go/issues/1877)) - JetStream: - `PushConsumer` implementation in `jetstream` package - Expose `ClientTrace` in `JetStreamOptions` ([#&#8203;1886](https://github.com/nats-io/nats.go/issues/1886)) - Service API: - Expose `WithEndpointPendingLimits` option ([#&#8203;1899](https://github.com/nats-io/nats.go/issues/1899)) - Legacy KeyValue: - `Error()` method to `KeyLister` and `KeyWatcher` interfaces ([#&#8203;1889](https://github.com/nats-io/nats.go/issues/1889)) ##### FIXED - Core NATS: - Fix timeoutWriter not recovering after first error ([#&#8203;1896](https://github.com/nats-io/nats.go/issues/1896)) - JetStream: - `Consumer.Next()` hangs after connection is closed ([#&#8203;1883](https://github.com/nats-io/nats.go/issues/1883)) - Fixed stream info request for strict mode ([#&#8203;1887](https://github.com/nats-io/nats.go/issues/1887)) - Ordered consumer not closing on connection close ([#&#8203;1885](https://github.com/nats-io/nats.go/issues/1885)) - Return a more appropriate error when Subject Transform is not supported ([#&#8203;1416](https://github.com/nats-io/nats.go/issues/1416)) - Fix subject transform comparison. Thanks [@&#8203;erikmansson](https://github.com/erikmansson) for the contribution ([#&#8203;1907](https://github.com/nats-io/nats.go/issues/1907)) - Legacy JetStream: - Use timeout from `JetStreamContext` if no deadline is set on ctx ([#&#8203;1909](https://github.com/nats-io/nats.go/issues/1909)) - KeyValue: - `Keys()` and `ListKeys()` returning duplicates ([#&#8203;1884](https://github.com/nats-io/nats.go/issues/1884)) - Fix subject prefix for the Create/Update operation in KV store. Thanks [@&#8203;SalvaChiLlo](https://github.com/SalvaChiLlo) for the contribution ([#&#8203;1903](https://github.com/nats-io/nats.go/issues/1903)) ##### CHANGED - Change `DefaultSubPendingMsgsLimit` ([#&#8203;998](https://github.com/nats-io/nats.go/issues/998)) ##### Complete Changes ### [`v1.43.0`](https://github.com/nats-io/nats.go/releases/tag/v1.43.0) [Compare Source](https://github.com/nats-io/nats.go/compare/v1.42.0...v1.43.0) #### Changelog ##### ADDED - Core NATS: - Add `nc.LocalAddr`, similar to `nc.ConnectedAddr` ([#&#8203;1877](https://github.com/nats-io/nats.go/issues/1877)) ##### FIXED - Service API: - Fix stopping service not unsubscribing from all endpoints. Thanks [@&#8203;arunsworld](https://github.com/arunsworld) for the contribution ([#&#8203;1872](https://github.com/nats-io/nats.go/issues/1872)) - Remove `fmt.Println` from `Service.Stop()` ([#&#8203;1880](https://github.com/nats-io/nats.go/issues/1880)) - Legacy KeyValue: - Fix possible race setting timer in kv.WatchFiltered ([#&#8203;1879](https://github.com/nats-io/nats.go/issues/1879)) ##### Complete Changes ### [`v1.42.0`](https://github.com/nats-io/nats.go/releases/tag/v1.42.0) [Compare Source](https://github.com/nats-io/nats.go/compare/v1.41.2...v1.42.0) #### Changelog ##### Overview This release adds per-key TTL functionality to key-value stores. It adds: 1. `LimitMarkerTTL` config option to enable automatic tombstone deletion. 2. `KeyTTL` option to `kv.Create()` 3. `PurgeTTL()` option to `kv.Purge()` ##### ADDED - KeyValue: - Added KeyValue per key TTL support and limit markers ([#&#8203;1864](https://github.com/nats-io/nats.go/issues/1864)) ##### Complete Changes ### [`v1.41.2`](https://github.com/nats-io/nats.go/releases/tag/v1.41.2) [Compare Source](https://github.com/nats-io/nats.go/compare/v1.41.1...v1.41.2) #### Changelog ##### ADDED - Core NATS: - Add `nc.RemoveStatusListener()` method ([#&#8203;1856](https://github.com/nats-io/nats.go/issues/1856)) ##### FIXED - Legacy JetStream: - Fix `Fetch` and `FetchBatch` memory leak ([#&#8203;1856](https://github.com/nats-io/nats.go/issues/1856)) - Legacy KeyValue: - Use context in when purging stream in `kv.PurgeDeletes()` ([#&#8203;1858](https://github.com/nats-io/nats.go/issues/1858)) - Bump golang.org/x/crypto to fix vulnerability ([#&#8203;1857](https://github.com/nats-io/nats.go/issues/1857)) ##### Complete Changes ### [`v1.41.1`](https://github.com/nats-io/nats.go/releases/tag/v1.41.1) [Compare Source](https://github.com/nats-io/nats.go/compare/v1.41.0...v1.41.1) #### Changelog ##### FIXED - ObjectStore: - Use default timeout for `ObjectStore.Get` when no deadline is set on ctx ([#&#8203;1850](https://github.com/nats-io/nats.go/issues/1850)) ##### IMPROVED - Remove `golang.org/x/text` dependency ([#&#8203;1849](https://github.com/nats-io/nats.go/issues/1849)) ##### Complete Changes ### [`v1.41.0`](https://github.com/nats-io/nats.go/releases/tag/v1.41.0) [Compare Source](https://github.com/nats-io/nats.go/compare/v1.40.1...v1.41.0) #### Changelog ##### Overview This release adds consumer priority groups to JetStream, exposing overflow and pinning policies. For more information on consumer priority groups, see [ADR-42](https://github.com/nats-io/nats-architecture-and-design/blob/main/adr/ADR-42.md). ##### Added - JetStream: - Consumer priority groups with pinned and overflow policies ([#&#8203;1826](https://github.com/nats-io/nats.go/issues/1826)) - `WithDefaultTimeout` option for JetStream API requests ([#&#8203;1843](https://github.com/nats-io/nats.go/issues/1843)) ##### Fixed - KeyValue: - Ensure timer is stopped when watcher is stopped ([#&#8203;1838](https://github.com/nats-io/nats.go/issues/1838)) - ObjectStore: - Ensure object watcher stop closes the updates channel ([#&#8203;1844](https://github.com/nats-io/nats.go/issues/1844)) - Core NATS: - Data race when reading current status in `sub.StatusChanged` and `nc.StatusChanged` ([#&#8203;1841](https://github.com/nats-io/nats.go/issues/1841)) - Reset channel after closing in `ForceReconnect` to avoid panic on subsequent `ForceReconnect` calls ([#&#8203;1842](https://github.com/nats-io/nats.go/issues/1842), [#&#8203;1846](https://github.com/nats-io/nats.go/issues/1846)) ##### Changed ##### Improved - Legacy JetStream: - Cancel `Fetch` and `FetchBatch` on reconnect ([#&#8203;1840](https://github.com/nats-io/nats.go/issues/1840)) - JetStream: - Invalid default in documentation for `OrderedConsumerConfig.InactiveThreshold` ([#&#8203;1845](https://github.com/nats-io/nats.go/issues/1845)) - KeyValue: - Stop the watcher before performing the purge operations for `PurgeDeletes` ([#&#8203;1839](https://github.com/nats-io/nats.go/issues/1839)) ##### Complete Changes ### [`v1.40.1`](https://github.com/nats-io/nats.go/releases/tag/v1.40.1) [Compare Source](https://github.com/nats-io/nats.go/compare/v1.40.0...v1.40.1) #### Changelog ##### Overview This release fixes an issue in legacy JetStream `Subscribe` which did not respect user-set context when creating a consumer. ##### FIXED - Legacy JetStream: - Set context from option when creating consumer in `js.Subscribe` ([#&#8203;1835](https://github.com/nats-io/nats.go/issues/1835)) ##### Complete Changes ### [`v1.40.0`](https://github.com/nats-io/nats.go/releases/tag/v1.40.0) [Compare Source](https://github.com/nats-io/nats.go/compare/v1.39.1...v1.40.0) #### Changelog ##### Overview This release focuses on adding support for new features from [NATS Server v2.11.0](https://github.com/nats-io/nats-server/releases/tag/v2.11.0). This includes: - Per message TTLs - Consumer pause and resume Batch direct get will be released in [orbit](https://github.com/synadia-io/orbit.go). Support for consumer priority groups will be added in the next minor release. ##### Added - JetStream: - Pause and resume JetStream consumer. Thanks [@&#8203;yordis](https://github.com/yordis) for the contribution ([#&#8203;1571](https://github.com/nats-io/nats.go/issues/1571)) - Per message TTL option for JetStream publish ([#&#8203;1825](https://github.com/nats-io/nats.go/issues/1825)) - Timeout option for async publish ([#&#8203;1819](https://github.com/nats-io/nats.go/issues/1819)) - Service API - Support for disabling queue groups at service, group, and endpoint levels ([#&#8203;1797](https://github.com/nats-io/nats.go/issues/1797)) - Core NATS: - `ReconnectErrCB` for handling failed reconnect attempts in a callback. Thanks [@&#8203;sschleemilch](https://github.com/sschleemilch) for the contribution ([#&#8203;1804](https://github.com/nats-io/nats.go/issues/1804)) ##### Fixed - JetStream - Invalid subscription on ordered consumer in leaderless cluster ([#&#8203;1808](https://github.com/nats-io/nats.go/issues/1808)) - Ordered consumer not restarting on no responders ([#&#8203;1827](https://github.com/nats-io/nats.go/issues/1827)) - Avoid ack id collision in PublishAsync ([#&#8203;1812](https://github.com/nats-io/nats.go/issues/1812)) - Possible panic in `Consumer.Fetch` ([#&#8203;1828](https://github.com/nats-io/nats.go/issues/1828)) - Use `resp.Error` to show NATS error in `deleteMsg`. Thanks [@&#8203;imariman](https://github.com/imariman) for the contribution ([#&#8203;1822](https://github.com/nats-io/nats.go/issues/1822)) - KeyValue - Deadlock when fetching keys from KV while messages are deleted/purged ([#&#8203;1824](https://github.com/nats-io/nats.go/issues/1824)) ##### Changed - Bump go version to 1.23 and update dependencies ([#&#8203;1821](https://github.com/nats-io/nats.go/issues/1821)) ##### Complete Changes ### [`v1.39.1`](https://github.com/nats-io/nats.go/releases/tag/v1.39.1) [Compare Source](https://github.com/nats-io/nats.go/compare/v1.39.0...v1.39.1) #### Changelog ##### Fixed - KeyValue: - Prevent `ListKeysFiltered` from returning deleted keys. Thanks [@&#8203;kruegernet](https://github.com/kruegernet) for the contribution ([#&#8203;1803](https://github.com/nats-io/nats.go/issues/1803)) ##### Improved - Remove stale experimental comment in Service API ([#&#8203;1805](https://github.com/nats-io/nats.go/issues/1805)) ##### Complete Changes ### [`v1.39.0`](https://github.com/nats-io/nats.go/releases/tag/v1.39.0) [Compare Source](https://github.com/nats-io/nats.go/compare/v1.38.0...v1.39.0) #### Changelog ##### Overview This release bumps the minimal go version in `go.mod` to `1.22`. ##### Added - JetStream: - Added `PullMaxMessagesWithBytesLimit` option for Consume and Messages ([#&#8203;1789](https://github.com/nats-io/nats.go/issues/1789)) - Added `Metadata` to `OrderedConsumerConfig`. Thanks [@&#8203;mwain](https://github.com/mwain) for the contribution ([#&#8203;1737](https://github.com/nats-io/nats.go/issues/1737)) - Added `JetStream.Options()` and `JetStream.Conn()` methods to `JetStream` interface ([#&#8203;1792](https://github.com/nats-io/nats.go/issues/1792)) - KeyValue: - Added `ListKeysFiltered` for listing keys with multiple filters. Thanks [@&#8203;somratdutta](https://github.com/somratdutta) for the contribution ([#&#8203;1711](https://github.com/nats-io/nats.go/issues/1711)) ##### Fixed - JetStream: - Fixed invalid heartbeat timer for `Consumer.Messages()` ([#&#8203;1786](https://github.com/nats-io/nats.go/issues/1786)) - ObjectStore: - Fixed invalid error being returned from `DeleteObjectStore` ([#&#8203;1762](https://github.com/nats-io/nats.go/issues/1762)) - WebSockets: - Fixed protocol parsing errors with websocket compression and PONGs. Thanks [@&#8203;rsafonseca](https://github.com/rsafonseca) for the contribution ([#&#8203;1790](https://github.com/nats-io/nats.go/issues/1790)) - Core NATS: - Protect against possible nil pointer panic ([#&#8203;1771](https://github.com/nats-io/nats.go/issues/1771)) ##### Changed - Bump go version to v1.22 ([#&#8203;1773](https://github.com/nats-io/nats.go/issues/1773)) ##### Improved - Fixed typo in JetStream docs. Thanks [@&#8203;davydog187](https://github.com/davydog187) for the contribution ([#&#8203;1758](https://github.com/nats-io/nats.go/issues/1758)) - Improved documentation of JetStream `Consume` and `Messages` options ([#&#8203;1770](https://github.com/nats-io/nats.go/issues/1770)) - Removed obsolete build tags ([#&#8203;1787](https://github.com/nats-io/nats.go/issues/1787)) ##### Complete Changes ### [`v1.38.0`](https://github.com/nats-io/nats.go/releases/tag/v1.38.0) [Compare Source](https://github.com/nats-io/nats.go/compare/v1.37.0...v1.38.0) #### Changelog ##### Added - Core NATS: - Added `UserInfoHandler` for dynamically setting user/password ([#&#8203;1713](https://github.com/nats-io/nats.go/issues/1713)) - Added `PermissionErrOnSubscribe` option, causing `SubscribeSync` to return `nats.ErrPermissionViolation` on `NextMsg()` if there was a permission error ([#&#8203;1728](https://github.com/nats-io/nats.go/issues/1728)) - Added `Msgs()` method on `Subscription`, returning an iterator (`iter.Seq2[*nats.Msg, error]`) for the subscription. This method is only available for go version >=1.23 ([#&#8203;1728](https://github.com/nats-io/nats.go/issues/1728)) - KeyValue: - Added `WatchFiltered` method to watch for updates with multiple filters ([#&#8203;1739](https://github.com/nats-io/nats.go/issues/1739)) ##### Fixed - Core NATS: - Fixed closing connections on max subscriptions exceeded ([#&#8203;1709](https://github.com/nats-io/nats.go/issues/1709)) - Removed redundant nil checks. Thanks [@&#8203;ramonberrutti](https://github.com/ramonberrutti) for the contribution ([#&#8203;1751](https://github.com/nats-io/nats.go/issues/1751)) - Add missing nats prefix to error ([#&#8203;1753](https://github.com/nats-io/nats.go/issues/1753)) - JetStream: - Fixed `PublishAsync` not closing done and stall channels after failed retries ([#&#8203;1719](https://github.com/nats-io/nats.go/issues/1719)) - Set valid fetch sequence in ordered consumer's `Fetch()` and `Next()` after timeout ([#&#8203;1705](https://github.com/nats-io/nats.go/issues/1705)) - Do not overwrite ordered consumer deliver policy if start time is set ([#&#8203;1742](https://github.com/nats-io/nats.go/issues/1742)) - Fixed race condition in `MessageBatch` ([#&#8203;1743](https://github.com/nats-io/nats.go/issues/1743)) - Legacy JetStream: - Fixed race condition in `MessageBatch` ([#&#8203;1743](https://github.com/nats-io/nats.go/issues/1743)) ##### Changed - Legacy Jetstream: - Added client retry for jetstream async publish old API. Thanks [@&#8203;pranavmehta94](https://github.com/pranavmehta94) for the contribution ([#&#8203;1695](https://github.com/nats-io/nats.go/issues/1695)) ##### Improved - Moved CI to github actions ([#&#8203;1623](https://github.com/nats-io/nats.go/issues/1623), [#&#8203;1716](https://github.com/nats-io/nats.go/issues/1716)) - Use errors.New instead of fmt.Errorf to improve efficiency. Thanks [@&#8203;canack](https://github.com/canack) for the contribution ([#&#8203;1707](https://github.com/nats-io/nats.go/issues/1707)) - Fixed invalid schemas in Service API documentation ([#&#8203;1720](https://github.com/nats-io/nats.go/issues/1720)) - Added mention of TTL reset in `kv.Update` method. Thanks [@&#8203;fmontorsi-equinix](https://github.com/fmontorsi-equinix) for the contribution ([#&#8203;1727](https://github.com/nats-io/nats.go/issues/1727)) - Updated installation commands in `README.md` ([#&#8203;1745](https://github.com/nats-io/nats.go/issues/1745)) - Bump `nkeys` to v0.4.9 ([#&#8203;1750](https://github.com/nats-io/nats.go/issues/1750)) ##### Complete Changes </details> --- ### Configuration 📅 **Schedule**: (UTC) - Branch creation - At any time (no schedule defined) - Automerge - At any time (no schedule defined) 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate CLI](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0NC41MC4xIiwidXBkYXRlZEluVmVyIjoiNDQuMTgxLjAiLCJ0YXJnZXRCcmFuY2giOiJtYWluIiwibGFiZWxzIjpbImRlcGVuZGVuY2llcyIsInJlbm92YXRlIl19-->
Author
Owner

ℹ️ Artifact update notice

File name: go.mod

In order to perform the update(s) described in the table above, Renovate ran the go get command, which resulted in the following additional change(s):

  • 4 additional dependencies were updated
  • The go directive was updated for compatibility reasons

Details:

Package Change
go 1.23.0 -> 1.26.0
github.com/klauspost/compress v1.18.0 -> v1.20.1
github.com/nats-io/nkeys v0.4.7 -> v0.4.16
golang.org/x/crypto v0.18.0 -> v0.57.0
golang.org/x/sys v0.35.0 -> v0.48.0
### ℹ️ Artifact update notice ##### File name: go.mod In order to perform the update(s) described in the table above, Renovate ran the `go get` command, which resulted in the following additional change(s): - 4 additional dependencies were updated - The `go` directive was updated for compatibility reasons Details: | **Package** | **Change** | | :------------------------------ | :--------------------- | | `go` | `1.23.0` -> `1.26.0` | | `github.com/klauspost/compress` | `v1.18.0` -> `v1.20.1` | | `github.com/nats-io/nkeys` | `v0.4.7` -> `v0.4.16` | | `golang.org/x/crypto` | `v0.18.0` -> `v0.57.0` | | `golang.org/x/sys` | `v0.35.0` -> `v0.48.0` |
renovate-bot force-pushed renovate/github.com-nats-io-nats.go-1.x from 1e5c8ead75 to 7a796e7652 2026-09-15 16:01:17 +00:00 Compare
renovate-bot force-pushed renovate/github.com-nats-io-nats.go-1.x from 7a796e7652 to 092db35de7 2026-09-17 13:01:00 +00:00 Compare
renovate-bot force-pushed renovate/github.com-nats-io-nats.go-1.x from 092db35de7 to 23a8573b67 2026-09-18 21:01:00 +00:00 Compare
renovate-bot changed title from chore(deps): Update module github.com/nats-io/nats.go to v1.53.1 to chore(deps): Update module github.com/nats-io/nats.go to v1.54.0 2026-09-18 21:01:01 +00:00
renovate-bot force-pushed renovate/github.com-nats-io-nats.go-1.x from 23a8573b67 to f05c67536a 2026-10-09 09:01:06 +00:00 Compare
renovate-bot added 1 commit 2026-10-23 17:00:57 +00:00
renovate-bot force-pushed renovate/github.com-nats-io-nats.go-1.x from f05c67536a to da54410f70 2026-10-23 17:00:57 +00:00 Compare
renovate-bot changed title from chore(deps): Update module github.com/nats-io/nats.go to v1.54.0 to chore(deps): Update module github.com/nats-io/nats.go to v1.55.0 2026-10-23 17:00:57 +00:00
All checks were successful
CI / build (pull_request) Successful in 2m8s
You are not authorized to merge this pull request.
This pull request can be merged automatically.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin renovate/github.com-nats-io-nats.go-1.x:renovate/github.com-nats-io-nats.go-1.x
git checkout renovate/github.com-nats-io-nats.go-1.x
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: flowmade-one/aether#160