Search code examples
c#azure-service-fabric

How to create actor proxy to remote Service Fabric cluster


According to the Service Fabric docs (https://azure.microsoft.com/en-us/documentation/articles/service-fabric-reliable-actors-introduction/), an actor proxy is created this way:

ActorId actorId = ActorId.NewId();

IMyActor myActor = ActorProxy.Create<IMyActor>(actorId, new Uri("fabric:/MyApp/MyActorService"));

await myActor.DoWorkAsync();

Ok, this works and connects to my local cluster. But I cannot figure out how to create a proxy to a remote cluster? (I have a three-node cluster with the IPs 10.0.10.10, 10.0.11.10, 10.0.12.10.)

I also tried to use the ServicePartitionResolver, which is explained here: https://azure.microsoft.com/en-us/documentation/articles/service-fabric-reliable-services-communication/, but without success.


Solution

  • ActorProxy and ServiceProxy today works best for connecting to actors and services within the cluster. You can expose a stateless service with -1 instance count that can accept the user requests and then use Actor and Service remoting to connect to the actor service within the cluster. In the future release we may offer out of the box application gateway that supports remoting.