Answer the question
In order to leave comments, you need to log in
messaging patterns?
I've been reading about messaging patterns, event-based interactions lately and got a little confused. For example, there is javaee and there is a task to send new notifications to the client to the browser.
Reading about pub-sub (queses and topics), I got the impression that they are more suitable for java-to-java messaging (at least I have not seen sub written in javascript anywhere). I also read about long polling and websockets, but sockets are not asynchronous request-reply (that is, messages must be stored in db, and not in queues, as javaee suggests). In general, I would like to push the message to all subscribed clients (and if they are offline, then deliver the message when they come in), without saving it in db. Please guide me on the right path, how is this solved in javaee.
Answer the question
In order to leave comments, you need to log in
You're right - queses / topics are server-side.
Regarding notifications to the client - what's not to like about long poling? In addition, Servlet 3.0 (i.e. starting with tomcat 7) supports asynchronous delivery from the server). We use Spring MVC 3.2.3 in the project and its DeferredResult is a very handy thing, you can see more details here http://spring.io/blog/2012/05/16/spring-mvc-3-2-preview-chat-sample
those. nothing prevents you from using pub/sub to get updates serverside and then deliver them asynchronously to the client
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question