[QUERY] EnableAmqpLinkRedirect not supported in connection string?
See original GitHub issueI’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
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (3 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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 theAzure.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. TheAzure.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].
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