Subscribing to ServiceBus for Notifications
-
08-03-2021 - |
Question
I've been doing some reading up this morning on developing client notification systems, and nodeJS seems to be part of my solution.
This question gave me some ideas, but I think what I want is a little more. And, it left me (after some research) with questions as to using Redis on a Windows server.
Communicating between Node.Js and ASP.NET MVC Application
So, to my question. I'm currently using MassTransit, and I'm happy with pub/sub in there, but how do I notify my clients? If I use nodejs to allow something like socketio to create connections with, I'm not seeing how I link node to my mvc layer.
I'm going to release this into a production Windows environment, so I can't use redis if it's not stable on Windows. It sounded like that would have been my missing link.
edit: I did intend to ask if couchdb is an option, and is it stable on windows as an alternative to redid?
Solution
You can use ZeroMQ, it can manage your pub-sub if you don't want to rely on Redis or you can just use MassTransit with the Node.js library from here: https://github.com/enix/MassTransit-JS
You really don't have to link your MVC app with your Socket.IO code, what you should do is keep them de-coupled and communicating through pub-sub. So each time you want to send a message to notify the users, you publish a message and the SocketIO logic gets it (being subscribed to a specific pubsub channel).
Another useful resource: Communicating between Node.Js and ASP.NET MVC Application