Search code examples
c#azure-service-fabric

How to push events to a C# client from an Azure Service Fabric Service?


I am trying to push an event from something happening in one of my services, hosted on a Service Fabric Cluster, to a C# client application.

Whilst communicating events within my cluster seems possible, (I am looking at using this https://service-fabric-pub-sub.socreate.it/), I cannot find a way to relay events from my Service's API Gateway back to the client application (after they have subscribed).

I have tried to look into setting up web sockets, and looked at Signal R, but I am not sure that these are the correct tools for what I am trying to achieve. Any suggestions of where to start looking would be a great help!

Thanks in advance!


Solution

  • The Pub Sub library you're looking at, is for messaging inside the cluster, without introducing external dependencies.

    If you want to send messages to applications outside of the cluster, you should use a message queue, like Azure Service Bus Queues.

    For receiving messages from the C# client within the cluster, you can use this library or source code, that implements a ICommunicationListener.