azure service fabric - Targeting a stateless replica on the same node when communicating over the ServiceProxy client -
i have deployed 2 stateless , singlepartion
microservices service fabric cluster, hosted on azure. want hook communication between these services this:
my masterdata web api service should prefer communicate masterdata serviceproxy service replica/instance on same node when calling method via serviceproxy client. if there's no replica/instance available on same node, connect node. code looks this:
var serviceclient = serviceproxy.create<imasterdataserviceproxy>(new uri("fabric:/sfapp/masterdataserviceproxy")); var result = await serviceclient.getmasterdata();
but communication this:
the serviceproxy connects randomly chosen replica/instance (due targetreplicaselector.default
). i'm missing communication options "targetreplicaselector.prefersamenode
". there way handle manually?
here's explanation: how can reach specific replica of stateless service
if still want it, either
- use http listeners on localhost or
- use stateful service (using statemanager optional)
Comments
Post a Comment