Hi guys,
Sorry for trying to reboot an old question here, but has anyone got a SignalR implementation to work?
Cheers,
Patrice
Hi Patrice,
the best way to integrate OS with SignalR is to deploy SignalR into a different dedicated infrastructure since the scalability and availability requirements of the WebSocket infrastructure are completely different from the Web Front Ends.
To integrate SignalR in your OS application, you can create a Web API application that setups SignalR and also exposes a REST service (POST preferably) that receives a parameter list of "Message" objects.
The REST service should be imported by your OS application.
The REST service list of "Message" objects parameter should be forwarded to the SignalR subscribed clients by your Web API application, so use a very generic structure for the Message class (I recommend having a Data property that is a JSON.NET JObject to make it flexible).
In your Web API application REST Service, you should make use of the ConnectionManager.GetHubContext method to obtain an instance of the respective SignalR Hub and use it push the respective Message objects to the Browser clients.
The Message object of the REST service should have a data property using a JSON.NET object and some client or group identifier that you can use to push messages to specific Browser clients and subscribed groups.
Two things you need to make sure is that the Websocket infrastructure reside in the same domain space (otherwise you have to setup CORS) and that you use Windows Server 2012 (no 2008!), but you should probably be aware of that.
More information can be found in this Webinar or this slideshare.
Good luck!
Tito
tmoreira wrote:
Tito , thanks a lot for the extensive info,
I will have look further into it, but this gives me a good start!
yes, I have integrated with SignalR before as well as other WebSocket implementations (NodeJS and Cloud based), what exactly do you want to know?
Regards,
Hi Tito,
Well I understand the technology behind websockets and SignalR. But how to actually implement it ? It seems to me that a dedicated SignalR server is needed to be able to scale up. So, how to set up this server, and how to set up Outsystems to work with it?
Patrice Oostermeyer
Have you looked at pusher? https://pusher.com/
(It's easier than running your own server and its also easy to integrate with outsystems platform)
Robert Chanphakeo wrote:
Hi Robert,
yes I have, and I got it to work.It is indeed relatively easy to set up.But the thing that's bothering me is, that it makes me dependend on some 3rd party service.When they go down, or connection is lost, my (enterprise) applications that rely on that service will stop working.That is a risk I'm not yet willing to make. Lets say we we want to have this risk 'in house'.
Hi Everyone,
I’m sharing a step-by-step guide to help you set up a real-time communication system using ASP.NET Core SignalR, hosted on IIS, and integrated with an OutSystems Reactive Web/Mobile App. This solution enables seamless WebSocket-based messaging between server and client.
🔧 1. Create ASP.NET Core SignalR Hub API
Install .NET SDK (6 or 7)
Scaffold a new Web API project:
Implement ChatHub.cs and UserHandler to manage connections.
Configure CORS and SignalR in Program.cs.
📮 2. Add REST API to Broadcast Messages
Create BroadcastController.cs to send messages to specific users using their userId.
Use IHubContext to push messages to connected clients.
🚀 3. Deploy to IIS
Publish the app and host it under IIS.
Ensure WebSocket Protocol is enabled and the .NET Core Hosting Bundle is installed.
Use a dedicated App Pool with No Managed Code.
🧪 4. Test with Postman
Send a POST request to the broadcast endpoint with JSON body:
Request: { "userId":"Hari", "message": "Hi Hari How are you "}
Response if "Hari" user connected :
{ "success": false, "message": "User not Connected"}
Response if user "Hari" is connected: ( In this client will be receveing the message from "ReceiveMessage" once connected.
{ "success": True}
🔗 5. Integrate with OutSystems Reactive Web App
Add signalr.js to resources.
"https://cdnjs.cloudflare.com/ajax/libs/microsoft-signalr/6.0.1/signalr.js
Use JavaScript blocks to:
Initialize the connection
Handle incoming messages via ReceiveMessage
Trigger client actions like updatetext
I have attached the dot net and outsystems code here for your reference.