Quantcast
Viewing latest article 5
Browse Latest Browse All 11

Message queues with RabbitMQ

Some brief notes from playing around with RabbitMQ. This is also a handy opportunity to further test the GitHub to WordPress integration before I post some longer code!

Things are easy on the Mac since homebrew, though sometimes the magic goes wrong.

rabbitmq is available through homebrew, install it the usual way:

brew install rabbitmq

Part-way through installing the dependencies, I got the error:

Linking /usr/local/Cellar/erlang/R15B01… Warning: Could not link erlang. Unlinking…

Turns out (from running ‘brew doctor‘) that some of my /usr/local directories belonged to root, so I fixed it with:

chown -R myuser:admin /usr/local/share/man

Followed by:

brew link erlang

Then you need pip, in order to install pika.

easy_install pip

(I think I got easy_install from installing the homebrew python; python seems infested with install tools; see stackoverflow’s why use pip over easy_install for information on old and busted versus new hotness).

So pip is there, next we install the actual python library for messaging:

sudo pip install pika==0.9.5

And then you’re good to go. Tutorial 1 code follows. Remember to start RabbitMQ before running either of these by doing:

rabbitmq-server

The receiver:

[github_cv url='https://raw.github.com/savs/RabbitMQ/aecb04ebc9bc899228f42dcf615da2c40a744103/receive.py']

The sender:

[github_cv url='https://raw.github.com/savs/RabbitMQ/aecb04ebc9bc899228f42dcf615da2c40a744103/send.py']

And that’s it.


Viewing latest article 5
Browse Latest Browse All 11

Trending Articles