JSF + AJAX push: live chat / notification system

I'm trying to add some features to my webapp, something like a live-user-to-user chat (like Facebook) and a real-time notification system.

Consider this scenario: We have two users: A and B.

A sends a message to B.

If the chat window between B and A opens in browser B, we update it by showing a new message in browser B. If the windows do not open, we need to show a notification or something in browser B.

So, having the PrimeFaces dialog as the chat window and the PrimeFaces NotificationBar to display notifications, how can I do this?

I cannot use pressing PrimeFaces as they do not work with Glassfish.

I learned about ICEPush, this seems to be a good way to do this, but something about the "rendering groups" stopped me from trying. How can I update only the SINGLE client if ICEPush talks about groups?

Create a new group for each client?

Something like: Does B have a group “BwithA” that updates when A sends a message to B and the chat is open, and a group “notificationsB” that updates when the chat windows close?

I can’t find out how to do this, because even using the groups in this way, it is A that must tell B that it needs to be updated, and A does not know if B should update the dialog or notification Bar

Hope the question is clear because it is not easy to explain.

Thanks in advance:)

+3
source share
1 answer

, Java- , , Primefaces Remote Command .

- p:remoteCommand. . javascript ( oncomplete ) " ". , - .

. JSF AJAX

UPD: . - JAX-RS - . : PubNub, Pusher ..

+1

All Articles