azure-signalr icon indicating copy to clipboard operation
azure-signalr copied to clipboard

Running Azure SignalR Emulator in docker

Open Arash-Sabet opened this issue 3 years ago • 7 comments

Is your feature request related to a problem? Please describe.

We have an application working in docker but it relies on an instance of an Azure SignalR Service hosted on cloud. Due to some business reasons, we want each instance of the docker image to use a segregated version of signalR service. Therefore, we want to embed the SignalR Emulator in it.

Describe the solution you'd like

I'd like to see an example of setting up this emulator in docker.

Arash-Sabet avatar Feb 17 '22 14:02 Arash-Sabet

May I ask the reason for not using self-host SignalR?

vicancy avatar Feb 21 '22 03:02 vicancy

@vicancy The reason is that the self-hosted signalR broadcasts disconnection event and all subscribers catch and process that in the development environment. This issue causes mishaps while testing the code by multiple developers.

Arash-Sabet avatar Feb 22 '22 20:02 Arash-Sabet

the self-hosted signalR broadcasts disconnection event

Could you illustrate this more? I think the disconnection event is triggered by one Hub server only.

vicancy avatar Feb 23 '22 05:02 vicancy

the self-hosted signalR broadcasts disconnection event

Could you illustrate this more? I think the disconnection event is triggered by one Hub server only.

The disconnection event will be caught and handled by all instances of the signalR client applications. We share docker images among developers which contains all tiers of our application (e.g. Azure Functions, ASP.NET app, etc.). Putting a SignalR emulator instance in our docker image rather than creating multiple services on Azure helps us have a more abstract environment.

Arash-Sabet avatar Feb 23 '22 12:02 Arash-Sabet

The disconnection event will be caught and handled by all instances of the signalR client applications

Do you mean "disconnection" event for a SignalR client? one SignalR client disconnect triggers one "disconnection" event for this particular client. Sorry but I still failed to get your real problem here.

The emulator is designed for easy local debugging for the transient serverless scenario, I am a little concerned about the design limitation and code quality of the Emulator to meet the PROD usage bar. Anyway, you can always install the Emulator using dotnet tool install -g Microsoft.Azure.SignalR.Emulator --version 1.0.0-preview1-10809 as the same way you install any other dotnet tools in docker if you like.

vicancy avatar Feb 24 '22 00:02 vicancy

Do you mean "disconnection" event for a SignalR client?

Yes

Arash-Sabet avatar Mar 02 '22 16:03 Arash-Sabet

Why "disconnection" event for one SignalR client will be handled by all instances?

vicancy avatar Mar 03 '22 07:03 vicancy

Please feel free to reopen the issue if there are any updates.

vicancy avatar Oct 26 '23 09:10 vicancy

It would be nice to have the emulator work with docker for the purpose of docker compose (e.g., cosmos db, azurite) and for use with Azure Functions which may not be dotnet.

oadrian2 avatar Nov 17 '23 02:11 oadrian2