using the Service correlation affinity scheme I have a stateless health monitoring service (WatchdogService) which pings my Timeservice periodically to check health.
The application manifest defines this correlation between the TimeService and the WatchdogService.
<DefaultServices>
<Service Name="WatchdogService">
<StatelessService ServiceTypeName="WatchdogServiceType" InstanceCount="[InstanceCount]">
<SingletonPartition />
<ServiceCorrelations>
<ServiceCorrelation ServiceName="fabric:/TimeServiceApplication/TimeService" Scheme="Affinity" />
</ServiceCorrelations>
</StatelessService>
</Service>
<Service Name="TimeService">
<StatelessService ServiceTypeName="TimeServiceType" InstanceCount="[InstanceCount]">
<SingletonPartition />
</StatelessService>
</Service>
</DefaultServices>
So in the WatchdogService I want to check the health of the service in the same node.
Currently my service is a singleton with an instance count of 1 but if i change this to -1 i want to ensure that the WatchdogService instance on node1 checks the health of the TimeService on node1.
Is there a quick way of finding instances of a service on the same node, and then finding its endpoints?
Below the line with localhost:8088 is where I want to be intelligently using my colocated service as this code won't work with an instance per node. https://github.com/tbertenshaw/FabricAllTheThings/blob/master/src/GuestApplication/WatchdogService/WatchdogService.cs