This recipe implements the Stream Circuit Breaker pattern that I discuss in depth in my book, Cloud Native Development Patterns and Best Practices (https://www.packtpub.com/application-development/cloud-native-development-patterns-and-best-practices). Stream processors that experience hard errors will continue to reprocess those events until they expire from the stream—unless the stream processor is implemented to set these errors aside by delegating them as fault events for processing elsewhere, such as described in the Resubmitting fault events recipe. This alleviates the traffic jam so that other events can continue to flow.
This recipe simulates events that will fail at different stages in the stream processor. Some events ...