开发者

what message queue systems are suitable for use on shared web hosting?

I am currently using a shared hosting web server, and am trying to set up a queue system which my main web site will post messages to. Then I will use something else (probably a cronjob) to process items in the queue.

I need something that is secure, so that other users on the machine cannot use my queue. The memory footprint should be as low as possible. Also, it should be easy to install without requiring admin access - I should be able to install to a custom directory in my home folder on the server.

RabbitMQ looks good, but it requires Erlang, and I haven't found out how to install and set it up without root access. Things like beanstalk, gearman do not seem to support开发者_JAVA技巧 authentication.

Any suggestions?


Why not just use a database? If you are planning on using a cronjob (i.e. the script will be called one time per minute at max), that seems like the best option to me.


You can simulate a message queue with files. Create a folder. Set the read and writer permissions as you like. Post a message as a new file, and move files into a 'done' folder when consumed. This is simple, requires no deamon, and is easy to test and debug.

Ideally you should follow this protocol:

When writing a new message file, write it as mymessage.tmp then when done writing, rename to mymessage.msg.

When consuming messages, only look for files name *.msg. Then rename to .reading, and when completely finished then delete, or move into a 'done' folder.

If you need to replay a message manually move it out of done, backing into the incoming folder.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜