diff --git a/sdk/eventhub/Microsoft.Azure.EventHubs/src/Amqp/AmqpClientConstants.cs b/sdk/eventhub/Microsoft.Azure.EventHubs/src/Amqp/AmqpClientConstants.cs index d7be6da102f03..7f674d2704c02 100644 --- a/sdk/eventhub/Microsoft.Azure.EventHubs/src/Amqp/AmqpClientConstants.cs +++ b/sdk/eventhub/Microsoft.Azure.EventHubs/src/Amqp/AmqpClientConstants.cs @@ -85,5 +85,6 @@ class AmqpClientConstants // Miscellaneous public const int AmqpSessionTimeoutInSeconds = 30; + public static TimeSpan ConnectionIdleTimeout = TimeSpan.FromMinutes(1); } } diff --git a/sdk/eventhub/Microsoft.Azure.EventHubs/src/Amqp/AmqpEventHubClient.cs b/sdk/eventhub/Microsoft.Azure.EventHubs/src/Amqp/AmqpEventHubClient.cs index eed945d213047..cf67cb2056392 100644 --- a/sdk/eventhub/Microsoft.Azure.EventHubs/src/Amqp/AmqpEventHubClient.cs +++ b/sdk/eventhub/Microsoft.Azure.EventHubs/src/Amqp/AmqpEventHubClient.cs @@ -209,7 +209,8 @@ static AmqpConnectionSettings CreateAmqpConnectionSettings(uint maxFrameSize, st { MaxFrameSize = maxFrameSize, ContainerId = containerId, - HostName = hostName + HostName = hostName, + IdleTimeOut = (uint)AmqpClientConstants.ConnectionIdleTimeout.TotalMilliseconds }; ClientInfo.Add(connectionSettings);