Skip to content

Commit 971ab94

Browse files
authored
fix(nats-jetstream): correctly count messages that should be redelivered (waiting for ack) towards keda value (#3809)
* fix: keda now include the messages that should be retried in the count of pending messages used for scaling Signed-off-by: Antoine Laffargue <[email protected]> * chore: update changelog Signed-off-by: Antoine Laffargue <[email protected]> Signed-off-by: Antoine Laffargue <[email protected]>
1 parent ed18762 commit 971ab94

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ To learn more about active deprecations, we recommend checking [GitHub Discussio
6767
- **General:** Respect optional parameter inside envs for ScaledJobs ([#3568](https://github.com/kedacore/keda/issues/3568))
6868
- **Azure Blob Scaler** Store forgotten logger ([#3811](https://github.com/kedacore/keda/issues/3811))
6969
- **Prometheus Scaler:** Treat Inf the same as Null result ([#3644](https://github.com/kedacore/keda/issues/3644))
70+
- **NATS Jetstream:** Correctly count messages that should be redelivered (waiting for ack) towards keda value ([#3787](https://github.com/kedacore/keda/issues/3787))
7071

7172
### Deprecations
7273

pkg/scalers/nats_jetstream_scaler.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ func (s *natsJetStreamScaler) getMaxMsgLag() int64 {
195195

196196
for _, consumer := range s.stream.Consumers {
197197
if consumer.Name == consumerName {
198-
return int64(consumer.NumPending)
198+
return int64(consumer.NumPending + consumer.NumAckPending)
199199
}
200200
}
201201
return s.stream.State.LastSequence

0 commit comments

Comments
 (0)