Messaging Patterns: Change Detection Events
Listen to a stream of events and produce a new event when a value changes.
Published on 23 May 2019 by @mathiasverraes
Listen to a stream of events and produce a new event when a value changes.
A consumer is interested in an event stream, but the consumer only wants to know when a particular value changes, and doesn’t care about the events where that value didn’t change. Optionally, the consumer only cares when the value changes more than a given interval.
A second intermediary consumer is placed in front of the original consumer. It acts as a filter, emitting Change Detection Events when the observed value is different from the previous event. It may also ignore changes that are too small for the original consumer.
Change Detection Events are often used in combination with Ephemeral Events.
The producer emits TemperatureWasMeasured
multiple times per second. A consumer is only interested in changes of 1°C or more. An intermediate consumer listens to the TemperatureWasMeasured
events. When an event arrives, it compares the temperature with the temperature from the previous event. If it differs by more than 1°C, it emits a TemperatureHasChanged
event.
Follow @mathiasverraes
Heuristic: Legacy Mirror
Article
Evaluate a novel idea by swapping the old and the new idea in time.
Model Storming Workshop
Presentation
Deliberately discover your domain, to get in Modelling Nirvana.