MQS (Minimalist Queue Services) is a minimalist queueing system in Free Software. The main purpose is to provide a set of basic methods in order to offer asynchronous messaging for program/application. Applications can use this type of services in order to store and retrieve message to dedicated queue in the queue services. This permits to avoid direct connection between applications and provides a simple asynchronous communication system. The MQS Daemon provides a simple set of XML-RPC methods for pushing and getting messages in a specific queue (so you can use the system with any application that can talk XML-RPC). The storing of the queue is in a database (e.g. Mysql, Postgresql...) or in dedicated file(s).
The project is at the early stages but plans to provide a basic, reliable and easy to use queueing services.
Don't hesitate to contact me (adulau@foo.be) if you want to add services, fix or make comments on MQS.
You can also read the Changelog .
The software requires Perl and various Perl modules (e.g. XML::RPC) and a database with a Perl DBI/DBD Interface (or QDBM with the QDBM Perl interface).
A basic example in Perl using MQS (you can use any XML-RPC Client) that use the queue called 'test' (we assume an anonymous access to the MQS server):
use RPC::XML::Client; use Data::Dumper; print "Submit message...\n"; for my $i (1 .. 10) { my $message = "A small message number ".$i; my $req = RPC::XML::request->new('mqs.SubmitMessage', 'auth:simple:test:testkey', $message, 'test', '', '-1'); my $res = $client->send_request($req); my $returnvalue = $res->value; print Dumper(\$returnvalue); } print "Get from queue test....\n"; for my $i (1 .. 2) { my $req = RPC::XML::request->new('mqs.GetMessage', 'auth:simple:test:testkey','test'); my $res = $client->send_request($req); my $message = $res->value; print Dumper(\$message); }
tar xvfz mqs-current.tar.gz cd mqs-current
mysqladmin create queue mysql queue <./sql/mqs.sql
<general> portrpc = 9000 portssl = 9001 sslcert = /etc/ssl/certs/stunnel.pem path = /some/where/over/the/rainbow/mqs-0.0.7/ # storage = QDBM storage = sqldatabase dbiurl = dbi:mysql:queue dbuser = adulau dbpassword = createqueue = 1 allowanonymousaccess = 0 </general> <queue> <test> priority = 10 getfromqueue = remove # getfromqueue = tag </test> <internal> priority = 0 getfromqueue = remove </internal> <brol33> priority = 0 getfromqueue = keep </brol33> </queue> <user> <queuemanager> authtype = simple sharedkey = samplekey allowCommand DeleteMessage allowQueue * </queuemanager> <test> authtype = simple sharedkey = anotherbadsamplekey allowCommand GetMessage SubmitMessage allowQueue chicon test testos </test> </user>
cd ./bin/ ./mqsd-control start
For SSL, you can make a simple startssl
cd ./bin/ ./mqsd-control startssl
<general> mqsurl = http://127.0.0.1:9000/ cleanuptiming = 600 authstring = '' </general>
./mqsmanagerd-control start
./client-test.pl
Copyright (C) 2003 Alexandre Dulaunoy <adulau@foo.be> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
$Id: index.wiki,v 1.6 2003/10/29 20:10:02 adulau Exp adulau $
Copyrights (C) 2002,2003 Alexandre Dulaunoy - released under the GNU Free Documentation license without any options