Hi,

I would like to share with anyone interested a prototype I have made for a
Web interface to Camel.
It is based on Jolokia (http://jolikia.org) which is a JMX agent that
provides access via http. Along with jolokia comes client interface
libraries for Javascript and Java. The Jolokia agent is deployable in
basically any kind of Java container; standard JVM, Web container, OSGi
container, and for example the agent is available as a ready to deploy OSGi
bundle. The solution I have created and tested (tested in Karaf) consists
of:

1) The Jolika OSGi Agent (download  it from jolokia.org)
2) A web application, packaged as a WAR (attached to this post)

Just put these two artifacts in Karaf's deploy directory and open a browser
(Firefox works best for me) at http://localhost:8181/camel-webui.

You would of course need some camel routes as well, and if you do not have
that, I have provided a blueprint with a couple of routes (attached as
dummy.xml). This requires camel-blueprint to be installed.

The WAR file only contains static content, one html file with embedded
javascript and some css for layout. The html file is not very large (below
200 lines - 50 html and 150 javascript).

Ok, so what can you do with this application:

1) It lists all available routes and some data about each route.
2) The current state is indicated by a button, typically labeled "Started".
If you press the button, the route will be suspended and the button label
will change to "Suspended".
3) On the right hand side of the route table you have a column called
"Monitor" and it has a checkbox for each route. When you tick a checkbox, a
diagram will appear. The diagram will show the activity (number of completed
exchanges) for all routes that currently have their monitor box ticked. The
data in the table will also be live updated for the monitored routes.

All interactions between the browser and camel is made via the Jolika
javascript library, which interacts with the Jolokia agent on the target
system. The Jolokia agent then interacts with the Camel MBeans.

I am not associated with Jolokia, but I like the possibilities their
components provide, namely building clients to applications and components
by just utilizing what these applications and components exposes via JMX
(their MBeans). 

I am not an HTML, CSS or Javascript expert, so there is probably a lot to
say about the code in my prototype, but it works fairly well, and I am
impressed by the kind of functionality you can create with 200 lines of
code.

Thanks

Lars http://camel.465427.n5.nabble.com/file/n5717349/camel-webui-1.0.0.war
camel-webui-1.0.0.war 
http://camel.465427.n5.nabble.com/file/n5717349/dummy.xml dummy.xml 





--
View this message in context: 
http://camel.465427.n5.nabble.com/Proof-of-concept-for-Camel-Web-Interface-tp5717349.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to