Question

We're starting work on a monitoring application that will be providing status for several pieces of hardware. The data will be updated on an Oracle DB by a backend process, this application will have to be developed in Java and deployed on a WebLogic 12c application server stuck behind an Apache HTTPD server.

Since the monitoring will be real-time, we'll be needing almost instant refresh of the data that was added on the database. To achieve this, I've been doing some tests with the following frameworks:

  • Hibernate as ORM.
  • Spring 3.0.5.
  • JSF 2.2 and PrimeFaces 3.5 with PrimeFaces Push (Uses Atmosphere).

My tests were successful and I was able to get something working quite quickly. However, I've noticed that Atmosphere has some potential that is being contained by the PF implementation, also, I don't know if this is the most lightweight solution.

Because of this, I wanted to ask you if you guys had any other approaches for this solution, i.e:

  • Spring MVC + Atmosphere.
  • Other MVC + Other Comet/WebSocket framework.

Most of the data shown will be for charts, tables and maps. The biggest limitation will be that everything must be Java compatible, since the application server won't be changed.

To summarize, my question is:

Which alternative options do you suggest for this project based on the requirements and limitations I established?

Let me know if you need additional information.

Was it helpful?

Solution

Spring 4 has good Websockets support, have a look here at the documentation. It makes possible to create a websockets endpoint, and use it in a publish-subscribe model based on the STOMP protocol.

This protocol is a messaging protocol that allows to subscribe to a topic and receive notifications, publish to a topic to all subscribed listeners or send a server push message to a single client.

Currently Websockets might not work for all users due to browser limitations, proxies that are not configured to forward the upgrade headers needed to upgrade from HTTP to Websockets, or network elements that timeout long-lived connections.

Spring 4 provides good support for this via SockJS, which has transparent fallback capabilities (to ajax, iframe) if a Websocket connection cannot be established.

All these things are needed to use Websockets in this day and age, and Spring 4 provides a complete out-of-the-box solution.

Have a look at this blog post to see how lightweight this solution is, specially if used together with Spring Boot.

If it's a frontend intensive application you might to couple Spring 4 with AngularJs, for frontend widget development. But Primefaces is a great solution, if the widgets they provide suit your needs it would spare a lot of work.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top