pyactivemq is a Python library that enables Python clients to communicate with ActiveMQ using both OpenWire and Stomp protocols. To do that it wraps ActiveMQ-CPP library, so it involves some compiling to make it all work. While building instructions for both ActiveMQ-CPP and pyactivemq and clear and concise, I found some additional steps were need to make it all work on Ubuntu box. I’ll post it here for my future reference and hopefully it can be useful to other folks.
This is tested with ActiveMQ-CPP version 2.2.6 and activemqpy 0.1.0
Let’s start with ActiveMQ-CPP. ActiveMQ-CPP depends on a couple of libraries listed on the wiki page. You can easily obtain them using something like:
$ sudo apt-get install autoconf $ sudo apt-get install automake $ sudo apt-get install libtool $ sudo apt-get install uuid-dev $ sudo apt-get install libcppunit-dev
But you also need to install the
build-essential package with
sudo apt-get install build-essential
This is now added to the wiki as well
Now we’re finally ready to start the ActiveMQ-CPP build. By following instructions on the wiki page, you should have ActiveMQ-CPP installed into
So, let’s get back to the pyactivemq. First thing you need to do is to edit
setup.py and point it to the location where ActiveMQ-CPP is installed. You can do that by changing all
/opt/activemq-cpp-x.x.x references to your
For successful build of pyactivemq you need to install one more dependency (Boost.Python) and you can do that with the following command:
sudo apt-get install libboost-python-dev
After these steps you can build and install pyactivemq.
There is just one more thing to do in order to successfully run scripts that use pyactivemq. You need to add ActiveMQ-CPP location to the list of shared libraries. To do that add the following line:
/etc/ld.so.conf file and run
$ sudo ldconfig
It’s finally ready. To test it, start your broker, go to the
src/examples directory and run
$ python asynclistener.py
Enjoy writing your Python application using ActiveMQ and pyactivemq.