activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alex Dean <>
Subject Re: Question about ajax.html examples on website
Date Fri, 14 Jan 2011 14:17:54 GMT

On Jan 13, 2011, at 4:13 PM, habumaster wrote:

> is the link I am referencing.
> The statement: 
> "The AMQ AjaxServlet needs to be installed in your webapplications to
> support JMS over Ajax:"
> I see this AjaxServlet installed in the ActiveMQ 5.4.1 install I am running.
> Does this mean I must still create my own webapp to be able to use this
> servlet?
> I have an existing Ruby on Rails app on another port that needs to
> communicate to ActiveMQ. 
> The Ajax Javascript clients provided must be expecting a webapp running on
> the same server to function.  
> Am I correct? or is there something else I am missing :)
> Thanks!

If you want to communicate with ActiveMQ from your server-side Ruby code, take a look at ActiveMessaging.  You don't need the AjaxServlet
to do that.

The AjaxServlet allows your clients (web browsers) to communicate with ActiveMQ.  We deploy
Ruby/Rails via Passenger, using Apache as the web server.  Apache also serves as a proxy for
ActiveMQ, so ajax requests stay in the same domain and don't violate JavaScript's same-origin

This Apache configuration, in your main server config or in a VirtualHost, should get you
started, though it might need to be tuned to your specific needs.
  ProxyRequests Off
  ProxyPass /amq http://localhost:8161 retry=10
  ProxyPassReverse /amq http://localhost:8161
  ProxyPassReverseCookiePath / /amq

A browser request for http://localhost/amq/ becomes a request for http://localhost:8161/.


View raw message