Another alternative would be to have the camel routes "publish" the data to some in memory data structure. Then your display/monitor system could read from this. The advantage here is that your monitoring system will survive refreshes.
On 20 October 2012 09:43, Claus Ibsen <[email protected]> wrote: > On Wed, Oct 10, 2012 at 8:55 PM, gonzalo diethelm <[email protected]> > wrote: > > I'm back on this list after some time; apologies if this is obvious or > previously discussed. > > > > I am thinking of the following architecture for a monitoring system: > > > > > > 1. A set of Camel routes that gather the information required from > many different sources / formats. > > > > 2. A Camel route that publishes this information on a websocket in > a given format (JSON?). > > > > 3. A Javascript "application" that gets the information from the > websocket and updates a set of divs in order to display it. > > > > 4. A set of HTML / JS / CSS files that give the application its > look & feel. > > > > I have been looking around and it seems points 1, 2 and 3 should pose no > challenge; there even are a couple of Camel examples that can be used as a > basis for this. > > > > My doubts are about point 4. Since I will be exporting the information > from Camel using a websocket, I will have an instance of Jetty running > under Camel. It looks like it would make sense to somehow configure this > instance of Jetty so that it also acts as a regular web server, where I > could host all the static files from point 4, to be served to the > application over http / https. This would mean the application talks to > Jetty over two channels, one websocket and one http / https. It would allow > me to tie everything up neatly in a single "application provider", rather > than having to configure a separate web server. > > > > Does this make sense? Would it work? How should I configure Jetty to do > this? Or this makes no sense and I should explore a different way? > > > > Yes the camel-websocket can support this. For example if you look at > the twitter example then we have static html pages, js scripts etc. > http://camel.apache.org/twitter-websocket-example.html > > The source code is in the Camel download or in the sv repo at > http://camel.apache.org/source.html > > > > Perhaps I need to write the server-side code as a Java app that has both > Jetty (as web server) and Camel (as EAI infrastructure, including its own > copy of Jetty) embedded into it? > > > > Thanks in advance and best regards, > > > > -- > > Gonzalo Diethelm > > DCV Chile > > > > > > > > > > > > ----------------------------------------- > > Declaración de confidencialidad: Este Mensaje esta destinado para > > el uso de la o las personas o entidades a quien ha sido dirigido y > > puede contener información reservada y confidencial que no puede > > ser divulgada, difundida, ni aprovechada en forma alguna. El uso no > > autorizado de la información contenida en este correo podrá ser > > sancionado de conformidad con la ley chilena. > > Si usted ha recibido este correo electrónico por error, le pedimos > > eliminarlo junto con los archivos adjuntos y avisar inmediatamente > > al remitente, respondiendo este mensaje. > > > > "Before printing this e-mail think if is really necesary". > > Disclosure: This Message is to be used by the individual, > > individuals or entities that it is addressed to and may include > > private and confidential information that may not be disclosed, > > made public nor used in any way at all. Unauthorized use of the > > information in this electronic mail message may be subject to the > > penalties set forth by Chilean law. > > If you have received this electronic mail message in error, we ask > > you to destroy the message and its attached file(s) and to > > immediately notify the sender by answering this message. > > > > -- > Claus Ibsen > ----------------- > Red Hat, Inc. > FuseSource is now part of Red Hat > Email: [email protected] > Web: http://fusesource.com > Twitter: davsclaus > Blog: http://davsclaus.com > Author of Camel in Action: http://www.manning.com/ibsen > -- -Sam
