You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@activemq.apache.org by "Dejan Bosanac (JIRA)" <ji...@apache.org> on 2010/12/10 16:59:02 UTC

[jira] Resolved: (AMQ-3015) Javascript client does not establish session properly.

     [ https://issues.apache.org/jira/browse/AMQ-3015?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dejan Bosanac resolved AMQ-3015.
--------------------------------

       Resolution: Fixed
    Fix Version/s: 5.5.0

Fixed with svn revision 1044412. It will be available in 5.5.0 version. Sorry we missed this earlier.

> Javascript client does not establish session properly.
> ------------------------------------------------------
>
>                 Key: AMQ-3015
>                 URL: https://issues.apache.org/jira/browse/AMQ-3015
>             Project: ActiveMQ
>          Issue Type: Bug
>    Affects Versions: 5.4.1
>            Reporter: Pete Schwamb
>            Assignee: Dejan Bosanac
>             Fix For: 5.5.0
>
>         Attachments: amq_session.patch
>
>
> In some configurations, the javascript client (amq.js) is not loaded from the same container that hosts the activemq broker.  For example, we have a Rails app and ActiveMQ both sitting behind apache, and the amq.js file is served directly by apache.
> In these kinds of configurations, when the javascript client first calls amq.init(), there is no JSESSIONID.  Both the POST to establish the subscription and the GET to start polling are delivered asynchronously, both without a JSESSIONID, and thus they each end up with different JSESSIONIDS, and the poll never returns any messages (as that session has no subscription).
> This small patch adds support for a callback mechanism that will allow clients to sign up using a callback mechanism that ensures that the JESSIONID is established properly before attempting to make a subscription, like this:
> {code:javascript:title=myclient.js|borderStyle=solid}
> amq.init({ 
>     uri: '/amq',
>     sessionInitializedCallback: function() { 
>         amq.addListener("display", "topic://sensors", onMessage);       
>     } 
> });
> {code}
> The patch is also backwards compatible, so existing code should still work (albeit with the same existing problem).

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