Need a Simple, Persistent, Single-System Queueing Solution
I have a desktop application that communicates directly with a service o开发者_如何转开发n the same system. I would like to decouple them and use a queue in the middle. Most of the queueing solutions I have found are really intended for enterprise use, not for inter-process communications.
So, my question for all of you is: Have any of you had experience with small-scale persistent queues? I was thinking of using Apache Qpid, or possibly running a small MySQL instance on the system. There is the Queue for MySQL (http://q4m.github.com/) project, but it looks a little young for use in a production system.
I am working on a similar problem. I need to have a relatively small queue persisted on disk because I need the ability to defer processing of each entry without risking to lose any data. I also need multiple processes to be able to queue simultaneously, and others to dequeue simultaneously.
My current idea is to create a disk based queue where each element is written in a file, and where the file name corresponds to the element key. All I need is to implement simple append, lock, unlock, delete and seek functions. Simple advisory file locking should suffice (Unix, C language).
I have yet to find a small library doing this. I think more and more I will roll my own since my problem is not very complex.
I eliminated SQLite because I cannot afford to lock my entire queue because I need high concurrency (the queue would be in a single table). I also eliminated large scale solutions like stxxl or ActiveMQ. They're totally overkill for my project. I have found some inspiration in the IPC-DireQueue Perl module implementing disk based queing/dequeuing (though I cannot use it in my project).
activemq http://activemq.apache.org/enterprise-integration-patterns.html
stxxl http://stxxl.sourceforge.net/
IPC-DireQueue http://metacpan.org/pod/IPC::DirQueue
精彩评论