I've been reading up on message queueing lately, and I'd like to implement a simple, extendable, system for my app. While there's a lot of good information on the subject of setting up a MQ system out there, I can't find a lot about the actual implementation.
I'm looking for patterns and best practices on how to properly format messages for a queue, and ways to execute the jobs in PHP. Should I use JSON, serialized objects, text, URLs or XML? What information should I send? Is a worker with a switch($job['command']) {}
(or something like that) the way to go, or are there any established patterns out there to implement a worker?
Help greatly appreciated!
You can pick any of the following MQ implementations in PHP, so you don't have to roll your own and you can look at their sourcecode to learn about their implementation. For general integration, have a look at the ActiveMQ page on Enterprise Integration patterns.
http://sourceforge.net/projects/beanstalk/
http://kr.github.com/beanstalkd/
http://activemq.apache.org/
http://memcachedb.org/memcacheq/
http://www.zend.com/en/products/server/
https://www.dropr.org/
http://gearman.org/
http://www.zeromq.org/