activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Howard W. Smith, Jr." <>
Subject Re: Connect ApacheMQ with web application using JMS
Date Thu, 16 Jan 2014 23:35:28 GMT
On Thu, Jan 16, 2014 at 12:30 PM, Ilya Kazakevich <> wrote:

> There is a servlet container with many concurrent users. Each user request
> works in its own thread from pool (tomcat is used)
> There is also ApacheMQ server that routes messages for users via JMS.

TomEE = Tomcat7 + ApacheMQ + other stuff in the stack for web app, ...

> To send message to user Mary you need to use topic "users.Mary".
> So, web server subscribes to this topic when user logs in and unsubscribes
> when user logs out.
> There are too many users and only few of them are logged into server, so we
> can't simply subscribe to "users.*": that would lead to millions of useless
> messages travelling over network.

Have you considered PrimeFaces Push (which is PrimeFaces + Atmosphere) or
even just Atmosphere (without PrimeFaces Push)? I am doing something
similar to what you are doing via PrimeFaces Push with not much code, and
performs very well.

> Each time user refreshes page, we need to display her all messages she got
> from last time page was refreshed.

PrimeFaces Push and/or Atmosphere will push messages via websocket or long
polling and there are PrimeFaces have ways you can render the messages on
the page for target user...without requiring user to do page refresh.

See PrimeFaces Push FacesMessage example[1]


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message