Communicating between Node.Js and ASP.NET MVC Application

前端 未结 2 1418
心在旅途
心在旅途 2021-01-12 06:36

I have an existing complex website built using ASP.NET MVC, including a database backend, data layer, as well as the Web UI layer. Rebuilding this website in another languag

2条回答
  •  -上瘾入骨i
    2021-01-12 06:57

    The only good option I'm aware of so far is to create a special listener on a specific port on the node.js server and connect to that, but I was wondering if there's a more elegant or more efficient method?

    You can try to look at redis pub/sub model where ASP.NET MVC application and node.js would communicate through separate channels in order to achieve full-duplex communication. Or you can also try to use CouchDB change nofitications.

    I also know that you could use a database inbetween but surely this would need to be polled and would be less efficient?

    Former techniques do not require you to poll for changes, but instead they will notify you when the changes happens or channel message arrives.

提交回复
热议问题