-
Notifications
You must be signed in to change notification settings - Fork 10
Description
There is regularly a need to replay events through our pipelines and, usually, only to a subset of consumers in a given pipeline.
In telecom, we've implemented this using a field in the envelope "replayTargets"[0] that is a list of consumer group names. Any consumer receiving an event where replayTargets is set must compare the contents of that list with their own CG name and consume only if their name is present[1].
Whether that's a good mechanism going forward is up for debate; that's how we've done it in the past.
For this to work at a go-pubsub level, it's hard to see how a standardised event envelope could be avoided.
[0] https://github.com/utilitywarehouse/telecom-contracts/blob/681fafc350b88c8ee147169cc6985fdf235f0c9c/schema/proto/Envelope.proto#L20
[1] https://github.com/utilitywarehouse/freecall-cdr-elasticsearch-indexer/blob/d830d60db88144748045715832099b7444fce332/consumer.go#L113-L115