activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daniel Varela Santoalla (JIRA)" <>
Subject [jira] Commented: (AMQ-1545) Chat sample not working properly with > 1 windows
Date Mon, 02 Mar 2009 10:21:59 GMT


Daniel Varela Santoalla commented on AMQ-1545:

Yes, this affects obviously not only the chat example but any instance where there is more
than one window open within the same session. Even having a single window, message reception
is altered by reloading that window, as I found out with some tests in Firefox 3 and Konqueror.
Results were quite inconsistent, sometimes missing messages altogether, sometimes the latest
window getting all of them, sometimes were alternating between windows.

I'm including a patch that might solve this problem, hopefully keeping compatibility with
any previous behaviour. It works by including a "windowId" in the "amq.url" parameter of the
HTML page, like this:

<script type="text/javascript">amq.uri='amq/window_'+Math.floor(Math.random()*100000);</script>

This parameter will be different for every window or "window reload", and then it is picked
up (through getRequestInfo) by WebClient and MessageListenerServlet to map different windows
to different listeners, allowing ALL of them to get the messages. After applying this patch
the chat example allows chatting between multiple windows of the same session.

Hope this helps.

> Chat sample not working properly with > 1 windows
> -------------------------------------------------
>                 Key: AMQ-1545
>                 URL:
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: Samples
>    Affects Versions: 5.0.0
>            Reporter: Glen Mazza
>            Priority: Minor
>             Fix For: 5.3.0
> Opening three browser windows of the Chat sample is resulting in it not working properly.
 Each message sent from one window gets picked up by only one of the three browser windows
(in rotating fashion).  It is possible to move to a publish-subscribe model for the javascript
comprising this example so all windows get each message sent?

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message