[rabbitmq-discuss] [Architecture] Real-time feed with RabbitMQ and NodeJS
Dexter
dexterp37 at gmail.com
Wed May 1 11:22:13 BST 2013
Hi,
I'm trying to design a system which allows for real time notifications
(sms, email, browser) on some topics. I'm having some doubts about the
architecture and on how I'm planning to use RabbitMQ. I'm sorry if the
question is naive, but I'm a newbie of RabbitMQ!
==== Requirements ====
- User profiles are stored in a database. Each user profile contains the
name of up to 2 topic of interest (i.e. Server1.CPU and
Server3.RAM.Temperature).
- Topic name won't change often
- Agents can post messages to a certain topic of interest (i.e. post
messages to Server1.CPU or to Server1, the latter should be received by
everyone subscribed to Server1.CPU or Server1.SomethingElse)
- User get notified using based on their choice (SMS to the phone number
stored in their profile or to the email address. Could also be to the
twitter account)!
- The system should be both vertically and horizontally scalable.
==== Architecture ====
(1) Agents -> (2) Thin NodeJS RESTful API -> (3) CouchDB -> (4)_changes ->
(5) CouchDB - RabbitMQ Bridge -> (6) Notifiers
1. Agents can be thought as services residing on a machine posting update
messages to certain topics through the exposed API
2. The exposed API, which allows to add messages to the database (CouchDB)
using a POST message call
3. CouchDB storing messages data, user data, etc.
4. A feed of changes coming from the DB which notifies (5) about new data
in the DB
5. This point is a bit tricky and is where I'm having some doubts.
I was thinking about using routing keys and topics (
http://www.rabbitmq.com/tutorials/tutorial-five-java.html ) and to let the
CouchDB-RabbitMQ nodejs application publish the messages to the queue
related to the topic of interest. Each queue acts as a task queue so that
the load can be distributed among different instances of notifiers for EACH
topic.
6. When a notifier consumes a messages, it gets the relevant data from the
database (i.e. mobile phone number for the SMS or twitter account name) and
notifies the user.
=== Questions ===
Is this a reasonable use case for RabbitMQ?
Is there any feature of RabbitMQ I'm misusing or not considering properly?
Is the queue organization in RabbitMQ correct?
Thank you for your help,
Dexter
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20130501/8207c7f5/attachment.htm>
More information about the rabbitmq-discuss
mailing list