Esper
The Esper component supports the Esper Library for Event Stream Processing. The camel-esper library is provided by the Camel Extra
project which hosts all *GPL related components for Camel.
URI format
esper:name[?options]
When consuming from an Esper endpoint you must specify a pattern or eql statement to query the event stream.
For example
from("esper://cheese?pattern=every event=MyEvent(bar=5)"). to("activemq:Foo");
Options
Name |
Default Value |
Description |
---|---|---|
|
|
The Esper Pattern expression |
|
|
The Esper EQL expression |
You can append query options to the URI in the following format, ?option=value&option=value&...
EsperMessage
From Camel 2.12 onwards the esper consumer stores new and old events in the org.apacheextras.camel.component.esper.EsperMessage
message as the input Message on the Exchange. You can get access to the esper event beans from java code with:
EventBean newEvent = exchange.getIn().getBody(EsperMessage.class).getNewEvent(); EventBean oldEvent = exchange.getIn().getBody(EsperMessage.class).getOldEvent();
By default if you get the body of org.apacheextras.camel.component.esper.EsperMessage
it returns the new event bean as in previous versions.
Demo
There is a demo which shows how to work with ActiveMQ, Camel and Esper in the Camel Extra
project