question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[QUERY] EnableAmqpLinkRedirect not supported in connection string?

See original GitHub issue

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 ?

The following sample code has both connection string builders

// var s =  new Microsoft.ServiceBus.ServiceBusConnectionStringBuilder(azureEventHubOption.EventHubConnectionString)
            var s = new EventHubsConnectionStringBuilder(azureEventHubOption.EventHubConnectionString)
            {
                EntityPath = azureEventHubOption.EventHubName,
                /* EnableAmqpLinkRedirect is not accepted as a valid connection string
                 Maybe future versions will allow this 

                EnableAmqpLinkRedirect = azureEventHubOption.EnableAmqpLinkRedirect
                */
            };
                        
            var eventHubClient = EventHubClient.CreateFromConnectionString(s.ToString());
System.ArgumentException
  HResult=0x80070057
  Message=Illegal connection string parameter name 'EnableAmqpLinkRedirect'
Parameter name: connectionString
  Source=Microsoft.Azure.EventHubs
  StackTrace:
   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

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
jsquirecommented, Jun 12, 2020

Forgive me, but I’m a bit confused as to your request. As I understand it, you were asking to opt-out of the redirect behavior and ensure that traffic uses only the standard AMQP ports. As mentioned, that is the behavior for the Microsoft.Azure.EventHubs library. To be clear: Microsoft.Azure.EventHubs will NOT make use of the 104XX port range.

I’m not sure if I misunderstood your intent, you are now expressing a different ask, or you believe that there is an issue with the library that you’re observing. Would you please be so kind as to help me understand?

For wider context, the Microsoft.Azure.EventHubs library has been superseded by the Azure.Messaging.EventHubs library and is currently in maintenance mode. Microsoft.Azure.EventHubs will continue to be supported for the foreseeable future, but is no longer delivering new features. The Azure.Messaging.EventHubs library is under active development and does not yet offer direct connections to partition nodes (aka AmqpLinkRedirect), meaning that it also will NOT not use the 104XX range of ports.

We are planning supporting this feature in the near term, but intend for it to be an opt-in behavior, not the default. The design and details for support can be found [here], and the work can be tracked [here].

1reaction
zodapopinskicommented, Jun 12, 2020

According to this part of the documentation. The Client can control this behaviour by the usage of the EnableAmqpLinkRedirect property.

If this is not a bug, then at least it’s a feature request to get the same functionality for the client in the Microsoft.Azure.EventHubs as for Microsoft.ServiceBus.Messaging

image

Read more comments on GitHub >

github_iconTop Results From Across the Web

'MultipleActiveResultsSets' Keyword Not Supported
I am trying to read from an SQL Server database which is hosted on MS Azure, through an ASP.NET WebForms website created in...
Read more >
Troubleshoot connectivity issues - Azure Event Hubs
There are various reasons for client applications not able to connect to an event hub. The connectivity issues that you experience may be ......
Read more >
Azure SQL Database connection strings
Connection strings for Azure SQL Database. Connect using Microsoft.Data.SqlClient, SqlConnection, MSOLEDBSQL, SQLNCLI11 OLEDB, SQLNCLI10 OLEDB.
Read more >
How to resolve "Microsoft.Data.SqlClient is not supported on ...
This article explains how to fix "Microsoft.Data.SqlClient is not supported on this platform" error in an Azure Function App.
Read more >
Storing Azure App Service secrets on Azure Key Vault
Specify the secret of type "Manual", give it a name and set the value to the current SQL Database connection string stored in...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found