I’m writing two web application that simulate the Publisher/Subscriber pattern. A client add a subscription from a JSF web application into a database through an EJB bean in the back end. Another client then publish a message from another JSF web application using the same EJB bean in the backend. This EJB bean need to notify all subscribers that match the published message. I’m looking for a way to notify all subscribers with something like JMS. It’s doesn’t matter if I use JMS or not but I have to use JSF and the notification must be asynchronous.
I was looking for something like Push technology and Comet and I found something in a previous post. This example use RichFaces which is compatible with JMS and JSF but it does NOT shows how to receive a message or use JMS. I found also this post that explain how to not use JMS with RichFaces but like I said I want to use JMS and maybe it’s my only solution to send/receive a message from a EJB bean. All the solution I found use only JSF Managed bean but what if you have to receive a notification from a EJB bean?
I think
WebSocketsis the technology you are looking fore. Take a look at PrimePushfor an implementation in PrimeFaces.
You can combine this with SEAM-JSF to have access to JMS resources via CDI annotations in your backing beans.