Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/290.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 如何禁用';EnableLinkRedirect';属性,以便从没有端口104XX的事件中心获取数据?_C#_Azure_Azureservicebus_Azure Eventhub - Fatal编程技术网

C# 如何禁用';EnableLinkRedirect';属性,以便从没有端口104XX的事件中心获取数据?

C# 如何禁用';EnableLinkRedirect';属性,以便从没有端口104XX的事件中心获取数据?,c#,azure,azureservicebus,azure-eventhub,C#,Azure,Azureservicebus,Azure Eventhub,我正在使用连接字符串连接Azure事件中心 为了避免使用TCP端口104XX,Microsoft必须将属性设置为false。默认值为真值 EventHubsConnectionStringBuilder根本没有此属性。并且,ServiceBusConnectionStringBuilder创建EventHubClient不接受的连接字符串 所以。。。然后如何禁用此标志以避免使用端口104xx System.ArgumentException HResult=0x80070057 Message=

我正在使用连接字符串连接Azure事件中心

为了避免使用TCP端口104XX,Microsoft必须将属性设置为false默认值为真值

EventHubsConnectionStringBuilder根本没有此属性。并且,ServiceBusConnectionStringBuilder创建EventHubClient不接受的连接字符串

所以。。。然后如何禁用此标志以避免使用端口104xx

System.ArgumentException
HResult=0x80070057
Message=非法连接字符串参数名称“enableMQplinKreDirect”
参数名称:connectionString
Source=Microsoft.Azure.EventHubs
堆栈跟踪:
位于Microsoft.Azure.EventHubs.EventHubsConnectionStringBuilder.ParseConnectionString(字符串连接字符串)
位于Microsoft.Azure.EventHubs.EventHubsConnectionStringBuilder..ctor(字符串连接字符串)
位于Microsoft.Azure.EventHubs.EventHubClient.CreateFromConnectionString(String connectionString)
位于C:\Projects\Nodinite\LogAgent.PickupService\Nodinite.LogAgent.PickupService.Helpers.AzureEventHubHelper.GetEventHubClient()中的Nodinite.LogAgent.PickupService\Helpers\EventHubHelper.cs:第59行

Microsoft.ServiceBus.Messaging库实现了
EnableLinkRedirect
功能,并在默认情况下启用了该功能。该实现没有被提交到
Microsoft.Azure.EventHubs
库中,这就是您无法找到禁用它的方法的原因

该功能通过使用标准AMQP端口(56715672)建立到事件集线器网关的连接,并请求服务提供分区节点直接连接的发现,这是将使用104xx端口范围的地方

默认情况下,服务不会尝试重定向,并且
Microsoft.Azure.EventHubs
库在连接时不会选择使用该功能。因此,您应该只看到标准AMQP端口上的事件集线器流量