Waldemar Quevedo
ac8b51a3ab
js: Add js.PullSubscribe and sub.Fetch APIs for pull consumers
...
Signed-off-by: Waldemar Quevedo <wally@synadia.com >
2021-03-17 19:09:54 -07:00
Jaime Piña
83a07e6f4f
Update tests
2021-03-17 16:37:36 -07:00
Jaime Piña
4b55d1367f
Update JetStreamManager to accept JSOpts
2021-03-11 13:06:24 -08:00
Jaime Piña
994c933b84
js: Replace JetStreamManager listers with iterators
2021-03-09 15:29:29 -08:00
Waldemar Quevedo
e61aa9efa2
js: Add ReplayOriginal policy and RateLimit
...
Signed-off-by: Waldemar Quevedo <wally@synadia.com >
2021-03-05 22:35:48 -08:00
Waldemar Quevedo
3678d91ccf
Merge pull request #663 from nats-io/jsm-consumer-names
...
jsm: Add StreamNames and ConsumerNames
2021-03-04 14:17:35 -08:00
Waldemar Quevedo
c04f781f28
jsm: Add StreamNames and ConsumerNames
...
Signed-off-by: Waldemar Quevedo <wally@synadia.com >
2021-03-04 14:08:25 -08:00
Jaime Piña
e4a53fb637
Add ExternalStream field to StreamSource
2021-03-04 12:03:21 -08:00
Waldemar Quevedo
9faf9b2e34
Merge pull request #666 from nats-io/more-sub-opts
...
js: Add more SubOpts: AckWait, MaxDeliver, MacAckPending
2021-02-28 17:00:25 -08:00
Jaime Piña
171c566564
Validate ack policy for pull consumers
...
Signed-off-by: Waldemar Quevedo <wally@synadia.com >
2021-02-28 14:41:48 -08:00
Jaime Piña
924bd70443
Remove configurePublish from MaxWait
...
Add AckWait for PubOpt and SubOpt
Update tests to use AckWait instead
2021-02-28 14:41:35 -08:00
Waldemar Quevedo
0d60a7769c
js: Update server, add test of updating a stream with sources
...
Signed-off-by: Waldemar Quevedo <wally@synadia.com >
2021-02-27 15:21:43 -08:00
Waldemar Quevedo
9c91f7d85f
jsm: Add fields for mirrors to StreamConfig
...
Signed-off-by: Waldemar Quevedo <wally@synadia.com >
2021-02-25 14:24:30 -08:00
Waldemar Quevedo
17713175b5
js: Test updates
...
Signed-off-by: Waldemar Quevedo <wally@synadia.com >
2021-02-24 14:57:04 -08:00
Waldemar Quevedo
cd50f85f1a
js: Add QueueSubscribeSync to JS context
...
Signed-off-by: Waldemar Quevedo <wally@synadia.com >
2021-02-10 15:49:33 -08:00
Waldemar Quevedo
46a5ea3edf
js: Handle 503 status when JS API unavailable in pull mode
...
Signed-off-by: Waldemar Quevedo <wally@synadia.com >
2021-02-09 17:40:22 -08:00
Waldemar Quevedo
7c44823185
js: Add GetMsg API to JetStreamManager
...
Signed-off-by: Waldemar Quevedo <wally@synadia.com >
2021-02-09 14:05:51 -08:00
Waldemar Quevedo
f266a3b0f2
js: Add Placement config to Stream
...
Signed-off-by: Waldemar Quevedo <wally@synadia.com >
2021-02-05 14:13:27 -08:00
Waldemar Quevedo
0144ef994f
js: Add helper to test in cluster mode
...
Signed-off-by: Waldemar Quevedo <wally@synadia.com >
2021-02-05 10:36:04 -08:00
Waldemar Quevedo
bb1d5e1c0d
js: Remove PushDirect option
...
Now that Ack can be used by non JetStream subscriptions,
to subscriber directly it is only needed to use a regular
subscription.
Signed-off-by: Waldemar Quevedo <wally@synadia.com >
2021-02-03 09:38:05 -08:00
Waldemar Quevedo
b8a5a1fcc4
js: Cleanup of JS consumers on unsub/drain
...
This adds logic to the client so that some type of consumers can
be cleaned up depending on whether `Unsubscribe` or `Drain` are called:
```go
// Deletes a consumer (both ephemeral and durables)
sub.Unsubscribe()
// Does not delete a durable consumers, but ephemerals are deleted.
sub.Drain()
```
This also means that both `nc.Drain` would also clean up any
ephemeral consumer that was created, but not doing anything
to durable consumers that were created or attached.
This way in case a durable is created and then an application restarts
and reattaches to the same durable consumer, then it can still delete
the consumer that it created with `Unsubscribe` or gracefully close
using `Drain` without deleting durable consumers.
Signed-off-by: Waldemar Quevedo <wally@synadia.com >
2021-02-03 00:03:34 -08:00
Waldemar Quevedo
3c9d1b174a
Request/Response handler should drain last
...
Sometimes async handlers will still be using the
request handler to receive responses, but these
can go missing if we drain the respMux first.
Signed-off-by: Waldemar Quevedo <wally@synadia.com >
2021-02-02 22:13:36 -08:00
Waldemar Quevedo
758fbdd947
Merge pull request #648 from nats-io/js-attach-rm
...
js: Make consumer attach based on durable name, remove Attach
2021-02-02 21:41:15 -08:00
Waldemar Quevedo
6edf755fde
Merge pull request #649 from wallyqs/js-ack-sync
...
js: Allow Acking of JS messages without JS context
2021-02-02 20:57:26 -08:00
Waldemar Quevedo
5a7adbce3f
js: Allow Acking of JS messages without JS context
...
Signed-off-by: Waldemar Quevedo <wally@synadia.com >
2021-02-02 16:37:53 -08:00
Waldemar Quevedo
e4f7287f45
js: Make consumer attach based on durable name, remove Attach
...
Signed-off-by: Waldemar Quevedo <wally@synadia.com >
2021-02-02 12:54:35 -08:00
Derek Collison
06bdec7381
Update for server fix
...
Signed-off-by: Derek Collison <derek@nats.io >
2021-02-02 12:13:30 -08:00
Derek Collison
134d97f9bc
Added API stats support to AccountInfo
...
Signed-off-by: Derek Collison <derek@nats.io >
2021-02-01 06:08:10 -08:00
Waldemar Quevedo
19a62e4649
js: Add AccountInfo to JetStreamManagement
...
Signed-off-by: Waldemar Quevedo <wally@synadia.com >
2021-01-22 15:19:39 -08:00
Waldemar Quevedo
bddf81b175
js: Prevent sending duplicated Acks
...
Signed-off-by: Waldemar Quevedo <wally@synadia.com >
2021-01-21 17:04:38 -08:00
Waldemar Quevedo
7221823fca
Add validation for durable names
...
Signed-off-by: Waldemar Quevedo <wally@synadia.com >
2021-01-13 16:04:20 -08:00
Waldemar Quevedo
7356ebbde0
js: Add Subscribe option for AckPolicy
...
Signed-off-by: Waldemar Quevedo <wally@synadia.com >
2021-01-13 12:04:56 -08:00
Waldemar Quevedo
9355a98b33
Add DeleteMsg to JetStream management
...
Signed-off-by: Waldemar Quevedo <wally@synadia.com >
2021-01-12 16:57:09 -08:00
Jaime Piña
3e0aed6da7
Remove snapshot logic
2021-01-06 13:35:35 -08:00
Jaime Piña
1a29e1be4a
Add more Stream and Consumer management APIs
...
This adds the follow APIs for Streams.
* UpdateStream
* DeleteStream
* SnapshotStream
* RestoreStream
* PurgeStream
* StreamLister
This adds the follow APIs for Consumers.
* ConsumerInfo
* ConsumerLister
* DeleteConsumer
2021-01-04 14:43:46 -08:00
Waldemar Quevedo
86a16bba8b
js: Add option to configure deliver policy from consumer
...
Signed-off-by: Waldemar Quevedo <wally@synadia.com >
2020-12-17 17:20:57 -08:00
Waldemar Quevedo
a3519e1e54
Merge pull request #621 from wallyqs/js-interfaces-split
...
Separate JetStream into smaller interfaces
2020-12-16 15:56:24 -08:00
Waldemar Quevedo
c1932e104c
Merge pull request #622 from wallyqs/js-golint
...
js: Fix a few golint errors
2020-12-11 09:43:24 -08:00
Derek Collison
94bf95aada
Make file storage the default, implementation for #623
...
Signed-off-by: Derek Collison <derek@nats.io >
2020-12-10 20:22:22 -08:00
Waldemar Quevedo
2720565ee5
js: Fix a few golint errors
...
Signed-off-by: Waldemar Quevedo <wally@synadia.com >
2020-12-10 16:23:58 -08:00
Waldemar Quevedo
1c03e2bdce
Separate JetStream into smaller interfaces
...
This separates the JetStream interface into two smaller interfaces:
A JetStream interface which is for producing and consuming messages
and a JetStreamManager interface for creating streams/consumers.
This also adds a new interface that is the compound of both called
JetStreamContext and is the one that is being returned when calling
`nc.JetStream()`.
This change allows to opt-in to the behaviors provided by the
JetStreamContext as needed, for example:
```go
// Can be used to produce/consume messages, but not for creating streams
var js nats.JetStream
js, err = nc.JetStream()
// Can be used for managing streams/consumers
var jsm nats.JetStreamManager
js, err = nc.JetStream()
// Can still be used to both create streams and publish
js, err := nc.JetStream()
```
Signed-off-by: Waldemar Quevedo <wally@synadia.com >
2020-12-09 16:28:03 -08:00
Derek Collison
b3392c3860
Fixed wrong variable reporting in test
...
Signed-off-by: Derek Collison <derek@nats.io >
2020-12-09 12:30:33 -08:00
Derek Collison
948f5f80a1
Add in StreamInfo
...
Signed-off-by: Derek Collison <derek@nats.io >
2020-12-09 06:29:07 -08:00
Derek Collison
4dd05a834f
Trying to ack a non JS msg would panic and hang
...
Signed-off-by: Derek Collison <derek@nats.io >
2020-12-08 13:06:23 -08:00
Waldemar Quevedo
fc22eef039
Fix AckSync test using import
...
Signed-off-by: Waldemar Quevedo <wally@synadia.com >
2020-12-03 01:31:43 -08:00
Derek Collison
60de70431f
JetStream API updates
...
Signed-off-by: Derek Collison <derek@nats.io >
2020-11-30 06:46:23 -08:00