Complex event processing (CEP) is event processing that combines data from multiple sources to discover complex relationships or patterns. The goal of CEP is to identify meaningful events (such as opportunities or threats) and respond to them as quickly as possible. Fundamentally, CEP is about applying business rules to streaming event data. For example, CEP is used in use cases, such as stock trading, fraud detection, medical claim processing, and so on.
The following image explains stream-processing architecture: