activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From niccotnt77 <>
Subject Topics, Consumers and Web Session
Date Mon, 05 Apr 2010 00:23:08 GMT

I'm using Active-MQ with AJAX for displaying messages coming from a topic. A
producer is correctly sending message topic://test and a consumer is reading
from it and displays messages on a web page. 

When I open two or more consumers on a single web page, or on multiple pages
within the same session I get a strange behavior. I expected a broadcast of
the messages to all the listening consumers, but what I see is some sort of
distribution of messages between them.

I went deeply inside the code and I noticed that the destination is tied to
one and only one consumer inside the session. Some questions:

1. how can I get more instances of a consumer for a specific topic, during
the same session?
2. if it's not possible, how can I assign a different session every time i
POST a 'listen' command?

I think the concept of 1-consumer per session is correct applied to an
application environment where i can create as many sessions as I like... but
applied to the web, it gets confusing. I think web session are very
different from JMS sessions, they have only the name in common. I think we
should tie the consumer to another kind of "session", maybe the listener id,
or a tag inside the request.

View this message in context:
Sent from the ActiveMQ - User mailing list archive at

View raw message