Home Contact

Event Stream Intelligence: Esper & NEsper

Additional Examples

This page summarizes the additional examples that come with the distribution and that are also available in source code.

A detailed description of each example can be found in the reference documentation.

Examples can be found in the "examples" folder of the distribution. Many examples are ready-to-run and provide scripts to compile and run the example from command line. Please see the readme file in the "examples/etc" folder for instructions.

JMS Server Shell with JMX extension

The server shell is a Java Messaging Service (JMS) -based server that listens to messages on a JMS destination, and sends the received events into Esper. The example also demonstrates a Java Management Extension (JMX) MBean that allows remote dynamic statement management.

The server shell is a low-latency processor for JMS byte messages. It employs JMS listeners to process message in multiple threads, this model reduces thread context switching for many JMS providers. The server is configurable and has been tested with two JMS providers. It consists of only 10 classes and is thus easy to understand.

The server shell sample comes with a client (server shell client) that sends events into the JMS-based server, and that also creates a statement on the server remotely through a JMX MBean proxy class.

J2EE Self-Service Terminal Management

This example has been described in the On Java article titled "Esper: Event Stream Processing and Correlation".

The example is about a J2EE-based self-service terminal managing system in an airport that gets a lot of events from connected terminals.

The example code in the distribution package implements a J2EE message-driven enterprise Java bean (MDB EJB). We used an MDB as a convenient place for processing incoming events via a JMS message queue or topic.

Assets Moving Across Zones - An RFID Example with a Swing GUI

This example out of the RFID domain processes location report events. Each location report event indicates an asset id and the current zone of the asset. The example solves the problem that when a given set of assets is not moving together from zone to zone, then an alert must be fired.

This example provides a Swing-based GUI that can be run from the command line. The GUI allows drag-and-drop of three RFID tags that form one asset group from zone to zone.

AutoID RFID Reader generating XML documents

In this example an array of RFID readers sense RFID tags as pallets are coming within the range of one of the readers. A reader generates XML documents with observation information such as reader sensor ID, observation time and tags observed. A statement computes the total number of tags per reader sensor ID within the last 60 seconds.

StockTicker

The multithreaded StockTicker example comes from the stock trading domain. The example creates event patterns to filter stock tick events based on price and symbol. When a stock tick event is encountered that falls outside the lower or upper price limit, the example simply displays that stock tick event. The price range itself is dynamically created and changed. This is accomplished by an event patterns that searches for another event class, the price limit event.

MatchMaker

In the MatchMaker example every mobile user has an X and Y location, a set of properties (gender, hair color, age range) and a set of preferences (one for each property) to match. The task of the event patterns created by this example is to detect mobile users that are within proximity given a certain range, and for which the properties match preferences.

QualityOfService

This example develops code for measuring quality-of-service levels such as for a service-level agreement (SLA).

The example measures and monitors operation latency and error counts per customer and operation. When one of our operations oversteps these constraints, we want to be alerted right away. Additionally, we would like to have some monitoring in place that checks the health of our service and provides some information on how the operations are used.

Addicted toJava IDE with unparalleled java code
analyzer (600+ built-in inspections)