Closed roeschter closed 1 month ago
diff --git a/cli/sub_command.go b/cli/sub_command.go
index 98c59d6..0f99f93 100644
--- a/cli/sub_command.go
+++ b/cli/sub_command.go
@@ -451,7 +451,10 @@ func (c *subCmd) subscribe(p *fisk.ParseContext) error {
}
subs = append(subs, sub)
} else {
- c.jsAck = false
+ if c.jsAck {
+ opts = append(opts, nats.AckExplicit())
+ }
+
sub, err := js.Subscribe(c.firstSubject(), handler, opts...)
if err != nil {
return err
is enough to make this work imo. When accessing a WQ it will error by default
$ nats sub --stream WQ
nats: error: nats: workqueue stream requires explicit ack
and then you pass --ack
to make it work, I like the error since ack on a WQ is destructive and so I prefer people opt into that behaviour explicitely.
Also worth noting it also doesnt work if there's a consumer on the WQ since there would be overlap. Personally I think not working against WQ is a feature - too easy to destroy all messages in the WQ with a simple fat finger.
Will not implement those changes, could accidentally delete QueuePolicy content. Adding to help for the time being
Improved description. Added support for ackPolicy