Skip to content

Commit 1df3ef9

Browse files
committed
add a topic cascading retry mechanism for care partner alerts
When a care partner alert encounters an error, the message is moved to a separate topic that will cause it to be retried after a delay. Any number of these topics can be configured. BACK-2499
1 parent 3201555 commit 1df3ef9

File tree

11 files changed

+1925
-83
lines changed

11 files changed

+1925
-83
lines changed

alerts/client.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ type PlatformClient interface {
4444
requestBody interface{}, responseBody interface{}, inspectors ...request.ResponseInspector) error
4545
}
4646

47-
// TokenProvider retrieves session tokens for calling the alerts API.
47+
// TokenProvider retrieves session tokens needed for calling the alerts API.
4848
//
4949
// client.External is one implementation
5050
type TokenProvider interface {

data/events/alerts.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,9 @@ func (c *Consumer) Consume(ctx context.Context,
5252
}
5353

5454
switch {
55-
case strings.HasSuffix(msg.Topic, ".data.alerts"):
55+
case strings.Contains(msg.Topic, ".data.alerts"):
5656
return c.consumeAlertsConfigs(ctx, session, msg)
57-
case strings.HasSuffix(msg.Topic, ".data.deviceData.alerts"):
57+
case strings.Contains(msg.Topic, ".data.deviceData.alerts"):
5858
return c.consumeDeviceData(ctx, session, msg)
5959
default:
6060
c.logger(ctx).WithField("topic", msg.Topic).

0 commit comments

Comments
 (0)