2173 Commits

Author SHA1 Message Date
Piotr Piotrowski
41de016ddd Release v1.46.0
Signed-off-by: Piotr Piotrowski <piotr@synadia.com>
v1.46.0
2025-09-22 18:41:39 +02:00
Piotr Piotrowski
2d3be0c81b [IMPROVED] Bump nats-server test dependency 2025-09-22 17:00:03 +02:00
Piotr Piotrowski
9726c6f3bc [ADDED] AllowMsgSchedules field to enable message scheduling in stream config (#1942)
Signed-off-by: Piotr Piotrowski <piotr@synadia.com>
2025-09-22 17:00:03 +02:00
Piotr Piotrowski
5e67170a31 [FIXED] Revert leftover no headers support changes (#1941)
Signed-off-by: Piotr Piotrowski <piotr@synadia.com>
2025-09-22 17:00:03 +02:00
Piotr Piotrowski
c85e27545a [ADDED] Introduce PersistMode for configurable persistence settings in streams (#1943)
Signed-off-by: Piotr Piotrowski <piotr@synadia.com>
2025-09-22 17:00:03 +02:00
Piotr Piotrowski
13d3ae2df4 [ADDED] AllowAtomicPublish option on stream config (#1940)
Signed-off-by: Piotr Piotrowski <piotr@synadia.com>
2025-09-22 17:00:03 +02:00
Piotr Piotrowski
60f17186ec [CHANGED] Remove no headers support (#1939)
Signed-off-by: Piotr Piotrowski <piotr@synadia.com>
2025-09-22 17:00:03 +02:00
Piotr Piotrowski
ec9b58f895 [IMPROVED] Add test veryfying if mirror can be updated to regular stream (#1934)
Signed-off-by: Piotr Piotrowski <piotr@synadia.com>
2025-09-22 17:00:03 +02:00
Piotr Piotrowski
3416ed073b [ADDED] New fields in ClusterInfo (#1935)
Signed-off-by: Piotr Piotrowski <piotr@synadia.com>
2025-09-22 17:00:03 +02:00
Piotr Piotrowski
460f3ded59 [ADDED] Prioritized priority policy (#1937)
Signed-off-by: Piotr Piotrowski <piotr@synadia.com>
2025-09-22 17:00:03 +02:00
Piotr Piotrowski
13537419c0 [ADDED] Counters support (#1932)
* [ADDED] Configuration field for msg counters

Signed-off-by: Piotr Piotrowski <piotr@synadia.com>

* [ADDED] NoHeaders option for GetMsg

Signed-off-by: Piotr Piotrowski <piotr@synadia.com>

* [ADDED] NoHeaders option for GetLastMsgForSubject

Signed-off-by: Piotr Piotrowski <piotr@synadia.com>

---------

Signed-off-by: Piotr Piotrowski <piotr@synadia.com>
2025-09-22 17:00:03 +02:00
Piotr Piotrowski
c857ae9d4f [ADDED] Support custom name prefix for ordered consumers (#1928)
Add a new NamePrefix field to OrderedConsumerConfig that allows users
to specify custom prefixes for ordered consumer names. When provided,
consumer names will be generated as {NamePrefix}_{sequence_number}
(e.g., "myapp_1", "myapp_2"). If not provided, the default behavior
of using a NUID as prefix is maintained.

Signed-off-by: Piotr Piotrowski <piotr@synadia.com>
2025-09-22 16:38:02 +02:00
Piotr Piotrowski
a9a04a9c37 [ADDED] Add Metadata support to KeyValue buckets (#1944)
Signed-off-by: Piotr Piotrowski <piotr@synadia.com>
2025-09-22 10:14:59 +02:00
Piotr Piotrowski
98a4735206 [ADDED] Context and timeout options to Messages.Next() plus Fetch context support (#1938)
* Add timeout support to MessagesContext.Next() with mutual exclusion
* [ADDED] FetchContext support for pull consumer operations
---------

Signed-off-by: Piotr Piotrowski <piotr@synadia.com>
2025-09-18 13:17:21 +02:00
Piotr Piotrowski
3d0a13a355 [IMPROVED] Return more specific cons info error on ordered consumer recreation (#1931)
Signed-off-by: Piotr Piotrowski <piotr@synadia.com>
2025-09-10 13:18:51 +02:00
Artem Shulga
5e20e852a4 [UPDATED] Add max consumers limit error (code=10026) (#1927)
Signed-off-by: Artem Shulga <dev.ashulga@gmail.com>
Co-authored-by: arlet <shulga@niuitmo.ru>
2025-09-09 09:38:28 +02:00
Piotr Piotrowski
3d824b07c6 [IMPROVED] De-flake TestHotSpotReconnect and fix kv per key TTL test (#1926)
* [IMPROVED] De-flake TestHotSpotReconnect

Signed-off-by: Piotr Piotrowski <piotr@synadia.com>

* Fixed failing per key ttl test

Signed-off-by: Piotr Piotrowski <piotr@synadia.com>

---------

Signed-off-by: Piotr Piotrowski <piotr@synadia.com>
2025-08-22 16:17:06 +02:00
Tomasz Pietrek
0ed86479d3 Release v1.45.0 (#1923)
Signed-off-by: Tomasz Pietrek <tomasz@nats.io>
v1.45.0
2025-08-20 06:50:44 +02:00
Piotr Piotrowski
20accc137f [FIXED] Track delivered count and auto-unsubscribe for channel subscriptions (#1913)
Signed-off-by: Piotr Piotrowski <piotr@synadia.com>
2025-08-19 17:32:51 +02:00
Piotr Piotrowski
7af9697b58 [FIXED] Handle empty response when creating a consumer (#1912)
Signed-off-by: Piotr Piotrowski <piotr@synadia.com>
2025-08-19 17:12:39 +02:00
Piotr Piotrowski
bf620311b8 [FIXED] Call ReconnectErrHandler for initial connection failures with RetryOnFailedConnect (#1915)
When RetryOnFailedConnect is enabled and initial connection fails,
ReconnectErrHandler is now called to report the error, allowing users
to debug initial connection issues.

Resolves issue mentioned in https://github.com/nats-io/nats.go/issues/1870#issuecomment-2853851326

Signed-off-by: Piotr Piotrowski <piotr@synadia.com>
2025-08-19 17:11:27 +02:00
Piotr Piotrowski
8407275920 [FIXED] Clear status listeners map on SubscriptionClosed event (#1914)
Signed-off-by: Piotr Piotrowski <piotr@synadia.com>
2025-08-19 16:57:56 +02:00
Piotr Piotrowski
d0027eb243 [IMPROVED] Add test checking KV TTL watcher updates (#1916)
Signed-off-by: Piotr Piotrowski <piotr@synadia.com>
2025-08-19 13:30:04 +02:00
Piotr Piotrowski
89faf3b11d [FIXED] CreateOrUpdateStream preserves domain prefix during updates (#1917)
When UpdateStream is used with domain-configured mirrors or sources,
the domain prefix is now properly preserved by converting domains
to external configurations consistently with CreateStream.

Fixes #1744

Signed-off-by: Piotr Piotrowski <piotr@synadia.com>
2025-08-19 13:28:05 +02:00
Waldemar Quevedo
069c9bea61 [ADDED] Handling for maximum account active connections exceeded (#1921)
The client should continue to try to reconnect following the
reconnection logic settings when running into account limit
error changes.

Signed-off-by: Waldemar Quevedo <wally@nats.io>
2025-08-19 12:03:33 +02:00
Byron Ruth
22f2b9dbce [ADDED] WithExpectLastSequenceForSubject publish option (#1920)
This utilizes the Nats-Expected-Last-Subject-Sequence-Subject header
that became available in 2.11.0.

Signed-off-by: Byron Ruth <byron@nats.io>
2025-08-16 12:16:54 +02:00
Piotr Piotrowski
7a260b8b93 Release v1.44.0 (#1910)
Signed-off-by: Piotr Piotrowski <piotr@synadia.com>
v1.44.0
2025-07-29 18:35:42 +02:00
Salvador Chinesta Llobregat
dfcb02dcdc [FIXED] Use mirror-aware prefix when updating KV key (#1903)
Create a valid Subject for mirrored streams by using the `kv.putPre` prefix which references the subject in the remote domain
2025-07-29 14:06:09 +02:00
Piotr Piotrowski
0bba2a9842 [ADDED] PushConsumer implementation in jetstream package (#1785)
Signed-off-by: Piotr Piotrowski <piotr@synadia.com>
Co-authored-by: Tomasz Pietrek <tomasz@nats.io>
2025-07-25 16:40:11 +02:00
Piotr Piotrowski
627a9f63c2 [FIXED] KeyValue Keys() and ListKeys() returning duplicates (#1884)
Use consumer pending count from creation time instead of first message
delta to fix race where concurrent updates could cause duplicate keys
during listing operations.

Signed-off-by: Piotr Piotrowski <piotr@synadia.com>
2025-07-25 13:43:43 +02:00
Waldemar Quevedo
9743171c2a Merge pull request #1909 from nats-io/fix-watcher-timeout
[FIXED] Use timeout from JetStreamContext if no deadline is set on ctx
2025-07-24 17:38:08 -07:00
Piotr Piotrowski
3bd15a8026 [FIXED] Use timeout from JetStreamContext if no deadline is set on ctx
Signed-off-by: Piotr Piotrowski <piotr@synadia.com>
2025-07-24 15:34:53 +02:00
Erik Månsson
0fc96b1daa [FIXED] Fix subject transform comparison (#1907)
When creating or updating a stream, the sources in the server response
will not be ordered, but the current code assumes so. The commit
removes that assumption.

Fixes #1906
2025-07-24 09:50:20 +02:00
Byron Ruth
ea3ef92823 [IMPROVED] Change DefaultSubPendingMsgsLimit comment to reflect actual value (#998)
* Change DefaultSubPendingMsgsLimit comment to reflect actual value

* Change constant to 500k
2025-07-09 13:52:54 +02:00
Lev
f038fb4bee [FIXED] Return a more appropriate error when subject transforms are not supported by server (#1416)
* [FIXED] nit: return a more appropriate error

* Fix error in UpdateStream()

Signed-off-by: Piotr Piotrowski <piotr@synadia.com>

---------

Signed-off-by: Piotr Piotrowski <piotr@synadia.com>
Co-authored-by: Piotr Piotrowski <piotr@synadia.com>
2025-07-09 12:59:05 +02:00
Piotr Piotrowski
ad6e34e1ae [FIXED] Ordered consumer not closing on connection close (#1885)
Signed-off-by: Piotr Piotrowski <piotr@synadia.com>
2025-07-09 12:48:02 +02:00
Piotr Piotrowski
62bc62889d [ADDED] Service API: WithEndpointPendingLimits option (#1899)
Adds ability to configure pending message/byte limits on service endpoints
to handle slow consumers gracefully.

* Add WithEndpointPendingLimits() option for endpoint configuration
* Support message count and/or byte limits (-1 for no limit)
* Enhanced NATSError with error wrapping support for proper error chains

Signed-off-by: Piotr Piotrowski <piotr@synadia.com>
2025-07-09 12:47:37 +02:00
Waldemar Quevedo
4832d7150b [FIXED] timeoutWriter not recovering after first error (#1896)
Signed-off-by: Waldemar Quevedo <wally@nats.io>
2025-07-07 16:39:35 +02:00
Piotr Piotrowski
ccb20c2a43 [ADDED] JetStream: Expose ClientTrace in JetStreamOptions (#1886)
Make ClientTrace field publicly accessible through Options() method.
Returns a copy to maintain read-only contract.

Signed-off-by: Piotr Piotrowski <piotr@synadia.com>
2025-06-30 12:04:38 +02:00
Piotr Piotrowski
b0b229c516 [ADDED] Error() method to KeyLister and KeyWatcher interfaces (#1889)
* [ADDED] Channel-based Error() method to KeyLister and KeyWatcher interfaces

The new Error() method returns <-chan error, enabling concurrent error
handling with select statements. This allows immediate detection of
timeout errors during key listing/watching operations.

Signed-off-by: Piotr Piotrowski <piotr@synadia.com>

* Returned closed err channel if watcher is nil

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Signed-off-by: Piotr Piotrowski <piotr@synadia.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-06-30 12:04:20 +02:00
Piotr Piotrowski
3146d564a5 [ADDED] UserCredentialBytes() option (#1888)
Allows passing JWT and seed credentials as byte slices instead of file paths.
Mirrors UserCredentials() but accepts bytes directly. Supports both separate
JWT/seed bytes and chained credential format.

Fixes #1873

Signed-off-by: Piotr Piotrowski <piotr@synadia.com>
Co-authored-by: AsyncLegs <noreply@github.com>
2025-06-23 11:48:38 +02:00
Waldemar Quevedo
1268c80484 Merge pull request #1887 from nats-io/maurice/stream-info-strict
Fixed stream info request for strict mode
2025-06-23 16:13:43 +09:00
Maurice van Veen
87fa36018f Fixed stream info request for strict mode
Signed-off-by: Maurice van Veen <github@mauricevanveen.com>
2025-06-23 09:02:33 +02:00
Piotr Piotrowski
0879849951 [FIXED] Consumer.Next() hangs after connection is closed (#1883)
* [FIXED] JetStream consumer hanging after connection closure

Fixes #1875

JetStream consumer operations would hang indefinitely after server
shutdown or connection closure.

Changes:
- Fixed core NATS closed handler bug for ChanSubscription and SyncSubscription
- Added ErrConnectionClosed error for better error context
- Enhanced Consume() to report connection closure via ConsumeErrHandler
- Improved Next() to wrap ErrMsgIteratorClosed with ErrConnectionClosed

Both Messages().Next() and consumer.Consume() now properly handle connection
closure and provide appropriate error reporting to applications.

Signed-off-by: Piotr Piotrowski <piotr@synadia.com>

* Fix consume not sending conn closed error, improve tests

Signed-off-by: Piotr Piotrowski <piotr@synadia.com>

---------

Signed-off-by: Piotr Piotrowski <piotr@synadia.com>
2025-06-20 15:44:55 +02:00
Piotr Piotrowski
8a48023f77 Release v1.43.0 (#1881)
Signed-off-by: Piotr Piotrowski <piotr@synadia.com>
v1.43.0
2025-06-03 10:22:43 +02:00
Piotr Piotrowski
d66b0136a7 [FIXED] Remove Println from Service API Stop() (#1880)
Signed-off-by: Piotr Piotrowski <piotr@synadia.com>
2025-06-02 22:30:40 +02:00
arunsworld
f5cb33f5b2 [FIXED] Stopping micro service should fully unsubscribe (#1871) (#1872)
Co-authored-by: Arun Barua <arun.barua@e2open.com>
2025-06-02 11:25:17 +02:00
Waldemar Quevedo
ebb52f19ea [FIXED} Possible race setting timer kv.WatchFiltered (#1879)
Signed-off-by: Waldemar Quevedo <wally@nats.io>
2025-06-02 11:20:56 +02:00
Waldemar Quevedo
abad5e66fc Merge pull request #1877 from alexbozhenko/expose_local_addr
Add nc.LocalAddr, similar to nc.ConnectedAddr
2025-05-27 18:09:08 -07:00
Alex Bozhenko
2ea3accacc Expose LocalAddr, similar to ConnectedAddr 2025-05-27 14:53:00 -07:00