Give a consumer's max-deliveries key one watcher, counting what was given up (issue 440)
The dead-letter row and a max-deliveries advisory without a token both said bus.<stream>.<consumer>.max-deliveries: each look added an observation and a line of evidence through the row, and the two overwrote each other's words. The row owns the key since issue 330, so the advisory watcher leaves it, and the row now says when the newest held message was given up, so a letter held for a day no longer reads as observed every 30 seconds. Times without Happened is refused, since the raise ignored it and an update counted it.
This commit is contained in:
@@ -276,6 +276,10 @@ func (o Observation) check() error {
|
||||
return fmt.Errorf("the condition %s says nothing", o.Key())
|
||||
case strings.TrimSpace(o.Source) == "":
|
||||
return fmt.Errorf("the condition %s does not say what raised it", o.Key())
|
||||
case o.Times != 0 && o.Happened.IsZero():
|
||||
// Times is what a record counts beside when it last happened: alone, the raise would ignore it
|
||||
// and an update count it, so the count would mean two things (novox/hq issue 440).
|
||||
return fmt.Errorf("the condition %s says how often it happened (%d) but not when", o.Key(), o.Times)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user