service-fabric-pub-sub
service-fabric-pub-sub copied to clipboard
Publish to specific stateless instance
I had a look through the code and couldn't see how messages are published to specific stateless service instances. Is that possible with this library?
I don't think that's possible with remoting. IServiceProxyFactory.CreateServiceProxy allows us to set the TargetReplicaSelector, but the only option for stateless services is RandomInstance
. And that makes sense. I don't think you're ever supposed to interact with a specific instance when working with a stateless service. Perhaps you are looking for a partitioned stateful service?
@danadesrosiers Thanks for the response. I asked as I'm currently using Actor Events to support messaging between back-end services and specific instances of a stateless service hosting SignalR.
https://github.com/olivergrimes/servicefabric-topicactor-signalr
I'm doing this to avoid the overhead of a standard backplane. The service-fabric-pub-sub documentation states that it supports stateless services, therefore I assumed there may have been another way to achieve what I ended up using Actor Events for.
The library is designed to pass messages between different services, not different instances of the same service. One queue is created per partition, which will be just one for a stateless service. The message is published to a single instance at random. Sounds like it's not what you need, unfortunately.