3

I am new to ASP.NET Core Razor(or MVC) page web development. I have an ASP.NET core web site deployed in a docker container and I have few other docker containers which are just .NET Core modules. Between the modules and the ASP.NET Core web page they would be talking over an RabbitMQ message bus or an Azure IOT Edge hub. Now if I get a message from one of the .NET Core module,I want to update the ASP.NET Core Index page view. I googled and I couldnt find a clear answer. Is polling using Jquery or Javascript and updating the view using Ajax the only option?

2
  • 2
    SignalR Commented Jan 27, 2018 at 5:23
  • Thanks. That looks a interesting option. Havent used it before. So how do I populate a SignalR class when I get a message on the hub? I see the code to get the instance of the hub class in javascript, but can I do it when I get data from Queue asynchronously? Commented Jan 27, 2018 at 5:36

1 Answer 1

2

What you need is full duplex communication between your client (webpage) and server (asp.net core MVC).

With a classic MVC Razor webapp, communication is half-duplex; it is one way from your client to your server, and unfortunately, never the other way around.

Popular solutions that would enable what you want to achieve are:

Sign up to request clarification or add additional context in comments.

3 Comments

SignalR seems a best fit looking at the chat sample. Only question I have is how I get instance of the hub class to broadcast message from non hub class. lets say from the program.cs file where i register for RabbitMQ broker messages
This is another question in itself. You may post another SO question then !
Thanks. I used the DI and got the instance of the hub.

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.