Database Reference
In-Depth Information
Getting started with Esper
Before we start conjugating Esper and Storm, let's try a small do-it-yourself exercise on
Esper alone to understand the structural components of the Esper as well as its wiring.
Let's build a case where we are attempting to get the list of scores above 10,000 in
Roulette.
We expect you to download the Esper bundle from EsperTech ( http://www.espertech.com/
community/ ) on to your POM before starting the coding. Or, you can use the Maven de-
pendency mentioned in the preceding section.
The following is the code snippet of the Esper event—in our example, this is Casin-
oWinEvent , a value object where we store the name of the game, the prize amount, and
the timestamp:
public static class CasinoWinEvent {
String game;
Double prizeAmount;
Date timeStamp;
publicCasinoWinEvent(String s, double p, long t) {
game = s;
prizeAmount = p;
timeStamp = new Date(t);
}
public double getPrizeAmount() {
return prizeAmount;
}
public String getGame() {
return game;
}
public Date getTimeStamp() {
return timeStamp;
}
@
Override
public String toString() {
Search WWH ::




Custom Search