The diagram below depicts the architecture with its components.
The WSO2 CEP architecture consists of the following components:
Event receivers
Event receivers receive events that are coming to the CEP. WSO2 CEP supports the most common adapter implementations by default. For specific use cases, you can also plug custom adapters. For more information, see Configuring Event Receivers.
Event streams
Event streams contain unique sets of attributes of specific types that provide a structure based on which the events processed by the relevant event flow are selected. Event streams are stored as stream definitions in the file system via the data bridge stream definition store.
Event processors
Event processor handles actual event processing. It is the core event processing unit of the CEP. It manages different execution plans and processes events based on logic, with the help of different Siddhi queries. Event Processor gets a set of event streams from the Event Stream Manager, processes them using Siddhi engine, and triggers new events on different event streams back to the Event Stream Manager. For more information, see Creating a Standalone Execution Plan.
Event publishers
Event publishers publish events to external systems and store data to databases for future analysis. Like the event receivers, this component also has different adapter implementations. The most common ones are available by default in the CEP. You can implement custom adapters for specific use cases. For more information, see Creating Alerts.
WSO2 CEP event flow
The diagram below depicts the event flow of WSO2 CEP.
- WSO2 CEP receives events from external event sources and data agents. These events have different formats such as XML, JSON, Map etc.
- WSO2 CEP supports a range of event receiver types to receive events in different formats. Each event receiver receives the events in a specific format based on its type, and converts them to a specific format which enables WSO2 CEP to process them.
- The converted events are forwarded to the event stream connected to the event receiver. Each event stream selects the events that pass through it based on a structure that consists of a unique set of attributes of specific types. Each event forwarded by the event receiver should meet the following conditions to pass through the event stream.
- It should have attribute values for attribute names that match that of the event stream.
- The data type of each attribute value should match the type specified in the event stream for the relevant attribute.
- The events selected by the event steam are forwarded to the execution plan that uses the stream mentioned above as an input stream. An execution plan processes the events selected and forwarded by event streams using Siddhi queries written in the Siddhi Query Language.
The events processed via the queries in the execution plan are forwarded to an event stream that is used by the execution plan as an output stream. This event stream forwards them to the connected event publishers.
- WSO2 CEP supports a range of event publisher types to publish processed events in a range of interfaces which require different formats such as JMS, KAFKA, SOAP etc. Each publisher converts the events into a specific format depending on its type before publishing the events in the relevant interface. The interface in which events are published can be dashboards, external event sinks or data stores.