Search code examples
azureazureservicebusazure-servicebusrelay

Azure Service Bus Relay Hybrid Connections load balancing


Relay Hybrid Connections is one of the options to grant access to a RESTful web services hidden behind a firewall. I was wondering how the load balancing would work. There are multiple stateless instances of this web service:

  • Would each of them register with the Relay service?
  • Would I then have one Relay endpoint and many listeners behind it?
  • How would the Relay service load balance?

Thanks in advance


Solution

  • Would each of them register with the Relay service?

    Would I then have one Relay endpoint and many listeners behind it?

    Per my understanding, since your web service is running under multiple stateless instances, you could construct the HybridConnectionListener instance on each of your web service instances for a better performance. As this official tutorial states about Listener interactions:

    The Hybrid Connections service endpoint allows up to 25 concurrent listeners on a Hybrid Connection.

    How would the Relay service load balance?

    As the Interaction model mentioned about Listener interactions:

    If there are 2 or more active listeners, incoming connections will be balanced across them in random order; fair distribution is not guaranteed.