If an ordered consumer was configured with a start time, on
retry, the copied consumer config would start with sequence
but the existing start time opt would conflict causing
a config error.
Fix#1281
Signed-off-by: Byron Ruth <byron@nats.io>
* Revert "[ADDED] Support for stream subject transform (#1200)"
This reverts commit c8608284eb.
* Revert "js: mirror test updates"
This reverts commit 424de47b25.
If a subject filter is specified in the StreamInfoRequest{} option,
then all matching subjects will be returned and not be capped to
the server limit of 100,000. It is internally using pagination
that was added in the server PR: https://github.com/nats-io/nats-server/pull/3454
The AllowDirect boolean must be set in the stream configuration.
When that is the case, then all servers (leader and replicas) are
part of a DQ group and can respond to a "DIRECT.GET" request.
The KeyValue store makes use of the direct get when connecting
to a stream with the AllowDirect option.
Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
- JS Servers need a special sequence on shutdown. Most of the time
the store was attempted to be removed before the server was shutdown,
which on Windows would result in an error and the next test may
recover the previous state.
- Made use of the jsClient() helper to remove typical connect+jetstream
code.
- Added some nats.Timeout() during connect so that Windows connect
to a server that is not running is faster than the default 2sec, which
may cause tests to run very long or simply fail.
Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
If user creates an ordered consumer and uses AutoUnsubscribe()
with the returned subscription, and if the ordered consumer was
reset (due to a gap detection), the library should resend an
UNSUB with adjusted max for the new subscription ID.
Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
Several issues:
- We send a "EOF" empty message which should not be counted as
the number of chunks used to reconstitute the asset
- Some "message filters" that are removed as part of the execution
of the filter's callback would not be put back for the following
"sync" test (we test async then sync).
Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
This would happen when pull requests would have filled the waiting
queue in the JetStream consumer and a 408 status was returned.
Resolves#809
Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
This is to align with newer version of the ADR describing the
subscription workflow:
- Removed option SubjectIsDelivery that was introduced in main branch
(but not released yet).
- Take into consideration the new ACK layout
- Make sure that OrderedConsumer rejects user configuring DeliverSubject
Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
They will be described in the release notes, but gist:
Added:
- `DeliverSubject()` option to configure the deliver subject of a JetStream consumer created by the `js.Subscribe()` call (and variants)
- `BindDeliverSubject()` option to subscribe directly to a JetStream consumer deliver subject (bypassing any lookup or JetStream consumer creation)
- Fields `DeliverGroup` in `ConsumerConfig`, `PushBound` in `ConsumerInfo`. They help making prevent incorrect subscriptions to JetStream consumers
- Field `Last` in `SequencePair`
Changed:
- With a `PullSubscription`, calling `NextMsg()` or `NextMsgWithContext()` will now return `ErrTypeSubscription`. You must use the `Fetch()` API
- If the library created internally a JetStream consumer, the consumer will be deleted on `Unsubscribe()` or when the `Drain()` completes
- Fail multiple instances of a subscription on the same durable push consumer (only one active at a time). Also, consumers now have the concept of `DeliverGroup`, which is the queue group name they are created for. Only queue member from the same group can attach to this consumer, and a non queue subscription cannot attach to it. Note that this requires server v2.3.5
- Attempting to create a queue subscription with a consumer configuration that has idle heartbeats and/or flow control will now result in an error
Fixed:
- Possible lock inversion
- JetStream consumers could be incorrectly deleted on subscription's `Unsubscribe()`
Resolves#785Resolves#776Resolves#775Resolves#748Resolves#747
Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
This introduces ordered consumers. They are a convenience over ephemeral, no ack, no redelivery, only deliver things in strict order setups.
We have the swap out when we detect gaps and change out the underlying sub and JetStream consumer, and we process the heartbeats as well, detecting gaps at the end or if a stream or consumer is pulled out from underneath of us.
Signed-off-by: Derek Collison <derek@nats.io>