[
https://issues.apache.org/activemq/browse/AMQ-1545?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=50137#action_50137
]
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.
Daniel.
> Chat sample not working properly with > 1 windows
> -------------------------------------------------
>
> Key: AMQ-1545
> URL: https://issues.apache.org/activemq/browse/AMQ-1545
> 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.