[rabbitmq-discuss] New to world of Message Queues
behzad.eslami at gmail.com
Fri Jan 13 14:26:03 GMT 2012
We have a service, where users sends code and we reply them with the answer.
The code is sent to us via Sms, and we'll reply via SMS.
Technically, `recv.php` running on Apache is responsible to handle
incoming SMS messages.
Once a SMS is recieved, we need to provide a reply for it.
There are dozens of Reply services.
Depending on the number which SMS is sent _TO_, a Reply service will
be responsible to answer.
Now I have a design idea, with an emphasis to scalability.
Once a SMS is recieved (recv.php?f=XXXXXXXXXX&t=YYYY&body=Blah blah):
1) recv.php reads the SMS header.
2) +YYYY indicates that the user wants to use the Football service. In
this service, users send us a code, asking for detailed info about
Football programs this week. We have many other services, e.g.
Whether, Acronyms, etc.
2) For +YYYY, we have a Queue, where we store incoming SMS messages.
In other words, for each Service, we've implemented a Queue.
3) There are dozens of Queues, and dozens of Listeners. A daemon
listens to an specific Queue, waiting for new SMS messages.
4) Now ListenerZ pops the SMS from the Queue, reads SMS's content, and
generates a `reply-sms` to be posted to the user.
5) ListenerZ inserts the `reply-sms` into a different Queue, named
6) Dispatcher reads all messages in this queue every second, and calls
a web service to send the reply SMS.
7) If SMS is sent successfully, it is logged into db. Otherwise, we
will re-insert it to `dispatch-queue` to send it later.
recv.php disributes SMS messages into queues, and dispathcer sends the
If i want to add a new service, i write a new listener, and bind it
with a queue.
Currently, I'm using PostgreSQL for queues! Which is not a good idea,
as i googled for it.
After googling, I found Gearman, RabbitMQ, ActiveMQ, ZeroMQ, RestMQ, etc.
How can i use RabbitMQ in my problem? All I need is a simple queue? or
a Job Server is better?
What do you think about my design and its distributed architecture?
Have you implemented something similiar?
Please let me know your recommendations.
P.S. I'm a web developer, and I'm very new to the world of Distributed
and I found RabbitMQ to be most popular one.
More information about the rabbitmq-discuss