Get Version


→ ‘Free Message Queue’


The project implements a queue system with a server and some client apis.

The server is a rack server that holds REST-named queues, so that the implementation can be changed rapidly. You can GET, POST, DELETE, HEAD queue messages using the normal HTTP requests. The system itself uses a configuration file ( to setup queues at startup or even at runtime. The queue implementations can be changed or you can develop own queues with ease.

For an simple administration try out the integrated ajax based web interface.

The client apis are implemented using the HTTP protocol, so that you can use even curl to receive messages. A client library for ruby is implemented right now, other languages will follow.

The queue itself is a RESTful url like http://localhost:5884/myQueueName/ or http://localhost:5884/myApplication/myQueueName/. If you do a GET request to this url with a web browser you will receive one message from the queue.

If you need some help in getting thinks running watch the screencasts.



sudo gem install fmq

First steps

After installing the gem you can start by creating a project:

fmq create my_project_name

next step is to change to the folder and start the FMQ server:

cd my_project_name
rackup -p 5884

The server will start and host a admin interface on http://localhost:5884/admin/index.html.

Have a look at rDoc to see how to use the client API and the queue configuration on the server.


If you have created your FMQ project you will find a file, that contains the configuration. But you can customize it in any way you like. Here is an example for a very basic setup:

require "fmq"

queue_manager = do
  setup_queue "/mail_box/your_name" do |q|
    q.max_messages = 10000
    q.max_size = 10.mb


Creating your own queues

You can easyly implement your own queues by extending the BaseQueue class:

class MyTestQueue < FreeMessageQueue::BaseQueue
  def put(message)
    puts "INCOMMING: #{message.payload}"
  def poll "Hello World", "text/plain" do |m|
      m.option["Time"] =

Ok, so if you have special needs or need a queue that processes a message in different ways it is easy to do…

Queues that ship with FMQ


Git, patches, forks and all that stuff

If you want to clone the git repository use the command below. Patches, forks and feature requests are welcome, please send them to fmq-3z (at)

git clone git://

or if you are behind a http proxy

git clone

Build and test instructions

after cloning the repository you can

cd fmq

to the directory. But in order to run the tests you have to start a FMQ server first:

cd default-server
rackup -p 5884

then run the tests

rake test


To check the performance we have done a load test. The system under test was a 2 GB dual-core intel 1.8 Ghz with 100 Mbit/s LAN and Ruby 1.8.6.
In the test we simulate 20 applications (with 20 threads). Each of this applications did 2 POSTs and 1 GET request for 30min. The POST requests where about 1KB.

This are the results (from 2008-06-10; Mongrel):

Test duration: 30:01 min
Average response time: 36 ms
Passed Transactions: 862203
Failed (because of connection timeout): 285
Transactions per second: 476,1
Transactions per minute: 28.749,60
Transactions per hour: 1.724.976


This code is free to use under the terms of the GNU GENERAL PUBLIC license (v3).

Vincent Landgraf, 25th July 2009
Theme extended from Paul Battley