tags:

views:

10

answers:

0

Hi.

I'm experiencing a very weird problem, subscribing to an ActiveMQ topic through Ajax. Here's my simple javascript code:

var priceHandler = 
{
  _price: function(message) 
  {
    if (message != null) {

  var store_id= message.getAttribute('store-id')
  var job_id = message.getAttribute('job-id')
  var status = message.getAttribute('status')

  alert("Job: " + job_id + ", Status: " + status);
}
 }
};


function portfolioPoll(first)
{
   if (first)
  {
     amq.addListener('store_status','topic://STORES.STATUS',priceHandler._price);
  }
}

amq.addPollHandler(portfolioPoll);

As you can see, I adopted the "Portfolio" sample from the activeMQ demos and made it subscribe to a different Topic (STORES.STATUS). I'm experiencing two problems:

  1. This doesn't read any topic map messages published to the topic (by a springJMS class from a web application).

  2. (weird): Whenever I run the html page that has this code, this js file gets overwritten halfway. Everytime I refresh the browser, half of this JS file gets appended to itself.

Anybody experienced this with ActiveMQ Ajax?

Thanks!