0

I have a stateless service on multiple nodes with dynamic endpoints.

I want to use the ServiceProxy with their dynamic endpoint like this one:

localhost:32010+dd1d0a27-1dec-49db-8960-83bf001355be-131329828855327547

How do I use ServiceProxy to connect to the specific node instance using that endpoint?

I'm instantiating the ServiceProxy like this:

ServiceProxy.Create<T>(new Uri("fabric:/XXX));, which will only find one of the instance nodes. I want to specify the node to connect to via the endpoint. How do I do that?

jugg1es
  • 1,560
  • 18
  • 33
  • Have you tried to pass listenerName parameter? – cassandrad Mar 03 '17 at 05:51
  • @cassandrad that wouldn't help because all of the listener names are the same because they're all identical, just on different nodes – jugg1es Mar 03 '17 at 14:04
  • I thought that it would be possible to specify n endpoints with different ports — one per instance — and register only one on every particular node, then Remoting will be able to find particular instance with help of Naming Service. Well, that was my plan to try. I didn't know that it will not work. – cassandrad Mar 03 '17 at 15:52

1 Answers1

0

There is no way to use Service Remoting to connect to a specific instance of a Stateless Service. You can only target specific partitions/replicas for Stateful Services.

Look at this SO answer.

Your options are basically:

  • Change to HTTP communication
  • Redesign as a Stateful Service

Another thing you might want to ask yourself is why you want to target a specific instance or node? Is it because you wan't some performance benefit? Do you have some other type of affinity from the client to the service you want to target?

Community
  • 1
  • 1
yoape
  • 3,285
  • 1
  • 14
  • 27
  • I want to target a specific instance because I'm writing a load balancer and I'm using the local cluster (we can't use Azure) and there isn't any load balancing available for the local cluster deployment from what I can tell. – jugg1es Mar 03 '17 at 14:07
  • You might get some help from looking at [this project](https://github.com/spoorendonk/service-fabric-reverse-proxy) for an SF reverse proxy, it's not exactly what you are looking to do, but there are some parts similar. – yoape Mar 03 '17 at 18:02