An easy to miss gotcha in Azure Service Fabric service with multiple listeners


If you’ve ever worked with Azure Service Fabric, then there is a high probability that you will have a service that creates multiple listeners, either to multiple ports to accept requests from different protocols or listeners to Azure services like service bus or IotHub.

In this case, you might have to create multiple communication listeners in your application. While doing this, there is a chance that you might miss one small thing which would eventually result in you getting the following error in the Service Fabric Explorer

As you can see in the error message, it says that a Unique name must be specified for each listener when multiple listeners are used. We can specify this name as the second parameter of ServiceInstanceListener class as shown below.

This will solve the error.

Hope this helps!

This entry was posted in .NET, C# and tagged , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *