activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Pete Schwamb (JIRA)" <>
Subject [jira] Created: (AMQ-3015) Javascript client does not establish session properly.
Date Thu, 04 Nov 2010 15:25:01 GMT
Javascript client does not establish session properly.

                 Key: AMQ-3015
             Project: ActiveMQ
          Issue Type: Bug
    Affects Versions: 5.4.1
            Reporter: Pete Schwamb

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:

    uri: '/amq',
    sessionInitializedCallback: function() { 
        amq.addListener("display", "topic://sensors", onMessage);       

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

View raw message