There are a few example programs demonstrating the REST messaging or Ajax in the activemq/activemq-web-demo module.

Running the Web Samples from version 5.0 onwards

In 5.0 we have integrated the Web Samples into the binary distribution. So Download a binary distribution then point your browser to http://localhost:8161/demo

Running the Web Samples on 4.1.x and earlier

To run the Web Samples, grab the Source or try Download a binary distribution. Then follow the Building instructions for the activemq-web module.

In particular type the following (assuming you have Maven installed)

cd activemq-web-demo
mvn jetty:run

This will run a Jetty server with a web application with an embedded ActiveMQ message broker.

Then clicking your browser on http://localhost:8080/activemq-web-demo/ should bring up the home page of the examples. The examples include

  • a sample stock porfolio with real time updates via Ajax. You need open a browser window for the market data publisher first, then open the portfolio screen and see your portfolio update in real time
  • a simple chat application showing how multiple uses can interact via Ajax using a simple JavaScript library to interact with the Ajax
  • simple HTTP GET / POST via regular web browser technology (hyperlinks and HTML forms)

Creating a WAR

If you would like to package up the examples as a WAR and then deploy it inside your own web container then try the following...

mvn war

which will build a WAR in the target directory.

See Also

Graphic Design By Hiram