Hi Mazz
This looks like a very good start. I need to delve into the code before commenting in
detail, but
- I guess the only other backend mdb (other than log-only and events) would be one that
passes the events to alerts engine
- Will all events of a particular type (e.g. log records) be presented to the Alerts
engine, or would we need some configurable filter that determines what events should be
passed on?
- Capturing logs is one of the categories I believe we are interested in (possibly via
Logstash etc) - so wouldn't this be done via a feed, probably from the agent? So a
REST API may be required
Regards
Gary
----- Original Message -----
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-event...
... 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-event...
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-event...
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.
_______________________________________________
hawkular-dev mailing list
hawkular-dev(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/hawkular-dev