Alarm system design
I've been asked to design an alarm system that would allow some users to create alarms, and others to listen to those alarms and do whatever they need to do. The users that launch the alarms want to have a shortcut (their systems are running Windows XP), so automatically the guys who are listening to possible alarms get the correspondent signal.
That is to say, if a user presses the key combination the petition is made automatically to the security people.
I've thought of developing this by creating a database that would contain location information of all the users in the system, and would also have alarms history. I was thinking on creating a new row for each alarm a us开发者_如何学Goer launches, and then having the security guys looking for new alarms generated. So basically something like:
- On shortcut launch script that creates a new row in ALARMS table.
- Cron or scheduled task on security guys checking for new alarms constantly.
I am pretty new on designing this kind of systems, and I was thinking if this is a good way to go. Also, I would appreciate if somebody knows how to assign the launch of a script to a system shortcut under Windows.
Appreciate any help, and let me know if more information is needed.
I would highly suggest using a message queue for this. You can submit a new message to the queue with a simple console app (with a shortcut on the desktop or something).
The "listening" systems would be notified immediately and you perform the corresponding action at that time.
Microsoft's built in queues work great:
http://msdn.microsoft.com/en-us/library/system.messaging.messagequeue.aspx
Or you can use RabbitMQ, which is more robust, but harder to get working out of the box.
This will save all the hassle of constantly hitting a database for updates.
Edit:
And, of course, you would also want to record all the calls in a database, for record-keeping.
精彩评论