I just finished switching decanter to EventAdmin. https://issues.apache.org/jira/browse/KARAF-3613

The idea is to replace our own Dispatcher interface with the standard EventAdmin.

Before my change a map of maps like this was transported: Map<Long, Map<String, Object>> events; The first step was to transport each event individually: Map<String, Object> event; . The key "timestamp" represents the creation time. I think it is no big issue to transport each event as the appenders do this anyway.

The next step was to replace the Map<String, Object> with the EventAdmin Event which is similar and to use the EventAdmin interface instead of Dispatcher.

The nice thing is that EventAdmin supports topics. So this allows for example to put the appender name of a log message into the topic. So appenders can listen to either the top level topic or a sub topic. Currently the appenders use the top level but we can change this easily.

You can see the result in branch EventAdmin:
https://git-wip-us.apache.org/repos/asf?p=karaf-decanter.git;a=tree;h=refs/heads/EventAdmin;hb=refs/heads/EventAdmin

Possible enhancements:
We could represent the mbean name as a topic.

For the elatic search appender a nice enhancement would be to use diferent index names for the jmx and log topics. As the data is very different I think it makes sense to
also use different ES indexes.

I would be happy about your feedback.

Christian

--
Christian Schneider
http://www.liquid-reality.de
        
Open Source Architect
http://www.talend.com

Reply via email to