[Hawkular-dev] Event Store

John Mazzitelli mazz at redhat.com
Tue May 12 15:20:16 EDT 2015


As per the watercooler call today, I renamed my prototype to "Events" ... take a look. Consider this a proposal for a starting point for an events component.

Git clone this:

https://github.com/jmazzitelli/hawkular-events

and "mvn clean install" from the top (the default branch is "events" - that's the one you want, not master)

Go to hawkular-events-distro/target, unzip the distro, and run wildfly*/bin/standalone.sh

At this point, the events component is running as a standalone component in wildfly (remember this was a prototype written a while ago - its essentially a mini-kettle with just the bus and events components).

Read the README for how you can send test events and look them up:

https://github.com/jmazzitelli/hawkular-events/blob/events/README.adoc

You'll notice the API jar is a separate artifact. All our other components that get deployed in the kettle can use the hawkular-events-api jar to send events. That API jar has this: https://github.com/jmazzitelli/hawkular-events/tree/events/hawkular-events-api/src/main/java/org/hawkular/events/common ... EventRecord is the domain object that you send (it is based on the bus framework, so its got full JSON support and can be used in the bus framework's listener APIs - which is why my MDBs are so small) - you send via the EventRecordProcessor (or a subclass if you wish to enhance it). Here's a couple of lines of code as an example that sends events (this is how the events test servlet sends events - essentially its how any component would do it) : https://github.com/jmazzitelli/hawkular-events/blob/events/hawkular-events-war/src/main/java/org/hawkular/events/EventsInsertServlet.java#L98L100

The events war just has some MDBs (aka bus listeners) and servlets (servlets are there mainly to test with). But the idea is that we have bus listeners for potentially different kinds of events, or listening to events over different queues (which is what I do here - LogOnlyEventsMDB takes events and logs them only - EventsMDB stores them in the backend datasource, currently just H2).

Note that there is no REST interface (as I understand it, the events component is only for internal consumption - only kettle components will be using it - feeds will not be sending in events - so no need for REST AFAICS).

Note the backend storage is RDBMS (H2) - we'd just have to implement a listener that stores to C*. Essentially do what this does: https://github.com/jmazzitelli/hawkular-events/blob/events/hawkular-events-api/src/main/java/org/hawkular/events/consumer/DataSourceConsumer.java

So, its a standalone component. It utilizes the hawkular bus framework. It provides an independent API jar that other kettle components can use in order to send events to the events component via the bus.



More information about the hawkular-dev mailing list