Merge pull request #2436 from nats-io/push-active-pull

Make sure PushActive is nil for pull consumers
This commit is contained in:
Derek Collison
2021-08-12 10:19:36 -07:00
committed by GitHub
2 changed files with 8 additions and 1 deletions

View File

@@ -1477,7 +1477,7 @@ func (o *consumer) info() *ConsumerInfo {
return nil
}
js := o.js
if o.active {
if o.isPushMode() && o.active {
pa = &PushActive{
Subject: o.dsubj,
Queue: o.qgroup,

View File

@@ -11860,6 +11860,7 @@ func TestJetStreamPushConsumerInfo(t *testing.T) {
Config: ConsumerConfig{
Durable: name,
DeliverSubject: deliver,
AckPolicy: AckExplicit,
},
}
req, err := json.Marshal(creq)
@@ -11928,6 +11929,12 @@ func TestJetStreamPushConsumerInfo(t *testing.T) {
if ci := consumerInfo("ik"); ci.Active != nil {
t.Fatalf("Expected active to be nil, got %+v\n", ci.Active)
}
// Make sure pull consumers report Active as nil.
createConsumer("rip", _EMPTY_)
if ci := consumerInfo("rip"); ci.Active != nil {
t.Fatalf("Expected active to be nil, got %+v\n", ci.Active)
}
}
// Issue #2213