How do I disable the 'EnableLinkRedirect' property in order to fetch data from the event hub without port 104XX?


I'm using a Connection string to connect with the Azure Event Hub.

In order to avoid the usage of TCP ports 104XX Microsoft has documented to turn the EnableAmqpLinkRedirect property to false. The default is True

The EventHubsConnectionStringBuilder does not have this property at all. And the ServiceBusConnectionStringBuilder creates a connection string that the EventHubClient does not accept.

So... how do I then disable this flag in order to avoid the usage of port 104xx ?

  Message=Illegal connection string parameter name 'EnableAmqpLinkRedirect'
Parameter name: connectionString
   at Microsoft.Azure.EventHubs.EventHubsConnectionStringBuilder.ParseConnectionString(String connectionString)
   at Microsoft.Azure.EventHubs.EventHubsConnectionStringBuilder..ctor(String connectionString)
   at Microsoft.Azure.EventHubs.EventHubClient.CreateFromConnectionString(String connectionString)
   at Nodinite.LogAgent.PickupService.Helpers.AzureEventHubHelper.GetEventHubClient() in C:\Projects\Nodinite\LogAgent.PickupService\Nodinite.LogAgent.PickupService\Helpers\EventHubHelper.cs:line 59

enter image description here

asked on Stack Overflow Jun 11, 2020 by Michael Olsson

1 Answer


The EnableLinkRedirect feature was implemented by the Microsoft.ServiceBus.Messaging library and enabled by default. The implementation was not brought forward into the Microsoft.Azure.EventHubs library, which is why you're unable to find a means to disable it.

That feature works by establishing a connection to the Event Hubs gateway using the standard AMQP ports (5671, 5672) and requesting that the service provide discovery for partition nodes to directly connect, which is where the 104xx port range would be used.

By default, the service does not attempt to redirect and the Microsoft.Azure.EventHubs library does not opt-in to that feature when connecting. As a result, you should only be seeing Event Hubs traffic over the standard AMQP ports.

answered on Stack Overflow Jun 11, 2020 by Jesse Squire • edited Jun 11, 2020 by Jesse Squire

User contributions licensed under CC BY-SA 3.0