0

A few years ago I was instructed to build an Windows Desktop application to control several devices, add and check data from a local database among other stuff. At the time the answer was very simple and I decided to create a WinForms application that provided a solution to the request, the app would control the devices, it would store data in a local database and it would show the data in it's UI.

Even though it worked perfectly for a while, the project has now expanded a lot, to the point were it consists in several projects including two REST API services working on different servers as windows services, a Xamarin Android and iOS apps that access those servers and some other stuffs. Obviously, my dicision of not separating the original Winforms server application's UI from the server stuffs has kick me in the rear. Another problem is that the solution has been working for a long time and the client does not want to give me much time for updating (which by the way it would probably require to rethink everything) so he want me to give him a fast and simple solution to the problematic server - client scheme.

So again I decided to try a fast solution (probably not the right one, but its a matter of time) and created a Blazor app that connects to the local database and it would work in the same server where the winforms app is, guaranteeing that none one will touch that app.

The problem now is that I need a way to show real time notifications in the blazor web UI and update its datagrids, etc., when the winforms app receive an event from one of the devices. At first I thought of SignalR, being the blazor app the server for SignalR and the winforms just a client, but I have no experience with it. Although if SignalR is the answer I'll deal with it.

So, the question is: which is the best way to send real-time event notifications from a winforms application to a blazor app?

Thanks in advance

4
  • Why would you write a Blazor app that requires the user to run the WinForms app it is replacing? Commented Aug 11, 2020 at 7:37
  • Looking away from large arch. changes. Probably for a fast patching I would consider adding a message queue like RabbitMQ or some other (simple) message broker. (RabbitMQ has docker so it is easy to setup.) The Winform app will put messages into a the queue as those arrive and the server side Blazor app could subscribe to the events and perform the required actions as the messages arrive. Commented Aug 11, 2020 at 8:11
  • The blazor app its not replacing the entire winforms app just its UI...the winforms app will still be controlling the devices....its not an elegant solution I know but it will give me a way to separate the client from the server for now Commented Aug 11, 2020 at 17:19
  • Maybe simplest, since both talking to the same db, have your winforms app save something to a table with some action type flag/indicator, then have your blazor app periodically poll that table and trigger refreshes as required Commented Aug 12, 2020 at 4:28

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.