The project outlines the usage of event processing within an event-driven architecture (EDA) in a lightweight way.
Note:
This project contains the examples of the article: Event-driven Microservices & Event Processing. The code is just for demonstration purposes – it is not production ready. The nomenclature does not distinguish between the terms complex event processing (CEP) and event stream processing (ESP). ESP is rather treated as a subset of CEP.
The event channel of the EDA is realized by the message-broker Apache Kafka. The CEP part is based on the event processing engine and event processing language from Esper. The Esper component of the EIP framework Apache Camel connects the event channel to the event processing engine. Additionally the Elastic stack is used to visualize some results/statistics of events that occurred.
The example can be started as a spring boot application.
The class CepExampleApplication.java
is the boot-class of the application.
Packages
de.codecentric.channel
– contains the event-channel integrationde.codecentric.events
– contains a few example events and a simplified event-structure to keep events standardized in the system. However Esper has it's own event-structure internallyde.codecentric.processing
– contains routes to create faked shopping-cart events and CEP examples which do complex event processing on the cart events
mvn install
A few hints to setup a testable environment and how to test the application are summarized in the environment-notes.
Start the application in your IDE or via command-line as an Spring Boot application. The application produces faked shopping carts CreateCartsRoute which are published to the event-channel. Furthermore the application reads from the event-channel, evaluates the incomming events and occasionally produces derived events. Consult the source code of CepExamplesRoute for details.