O
O
oldnewbie2016-06-21 17:58:19
ASP.NET
oldnewbie, 2016-06-21 17:58:19

How to organize communication between ASP.NET Web API + windows service + SignalR?

Hello, I would like to ask your advice on system architecture. Now there is a service (Server) that receives and sends messages via comport to the device, the service also writes the received messages to the database. There is also a thick client, which the service notifies via socket that something happened in the comport and got into the database. The fat client itself knocks on the database and retrieves messages from it. We want to rewrite the system for web clients, but there were some difficulties in understanding how to do it. The client interface will be rendered in ASP.NET MVC, how to bind a service to MVC? On the one hand, you can use SignalR as a means of passing messages from MVC to the service and vice versa, and just use SignalR to communicate the web interface with MVC and, it seems, everything looks pretty smooth, but one more question arises: Is it ok to send messages from web clients to the server via normal forms (and take advantage of the built-in MVC tools like model validation) and receive messages from the server via SignalR? - I see a mixture of REST and RPC, which is confusing. Writing to the database can be done both from the service and from MVC, should operations with the database be separated into a separate service? If you highlight, then how should MVC and the service be associated with the service writing to the database?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergey Konovalov, 2016-06-30
@zakar1ya

Why not use signalr only to send messages to the client, but to communicate services with mvc, rabbitmq?

A
Artur Nurullin, 2016-06-30
@Splo1ter

Zyan Communication Framework, host service, ASP.NET MVC client. That's all.
If there is a lot of traffic then RabbitMQ + Mass Transit.
Only the service writes to the database. Zyan acts as a facade.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question