Service Fabric service with multiple listeners that use IUniformSession

servicefabric

(Francesc Castells) #1

Our Service Fabric services can use one or more communication listener from:

  • WebApi listener
  • Remoting listener
  • Message Bus listener

The Message Bus listener is based on this NSB documentation and it works correctly.

The problem is when the same service uses another listener, like remoting or a WebApi and it also needs the NSB endpoint. The services injected in controllers or used in the remoting listener expect a IUniformSession, but the IUniformSession is initialized and registered during the start up of the Bus Communication listener.

How can we correctly set up an NSB endpoint to be used in multiple listeners? or should we create an endpoint on each listener?