EJB-to-Client Notification
Tuesday, 16. October 2007, 15:10:30
A few days ago a fella asked me how he can notify (Swing-based) clients of his EJB based application of certain events that occur inside the EJB server (deletes, updates, inserts, etc.)?
My answer was that he has two use JMS for this purpose. He was arguing that JMS is for server-to-server communication, which, of course, is incorrect.
He was asking for something that accomplishes this in a way "as easy as ICEFaces". Well, the problem with ICEFaces' approach is that in ICFaces, your clients periodically send requests to the server to synchronize their states, and this approach, is very inefficient. Actually, it is possible to implement an efficient solution this way, but ICEFaces' approach, is inefficient.
He didn't have a very happy experience with JMS and did not want to go through its complexities once again. But fortunately, there are a few nice POJO based solutions (such as Spring) available today that hides away lots of these complexities and makes using JMS much easier.