Skip to content

Commit

Permalink
Update MQTT and AMQP minor package versions (#3278)
Browse files Browse the repository at this point in the history
* Update MQTT and AMQP minor package versions

* Change in behavior of MQTT lib
  • Loading branch information
drwill-ms authored Apr 18, 2023
1 parent 45d7e34 commit ec9441e
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 26 deletions.
9 changes: 2 additions & 7 deletions e2e/Tests/helpers/templates/FaultInjection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using System.Threading.Tasks;
using FluentAssertions;
using Microsoft.Azure.Devices.Client;
using MQTTnet.Client;

// If you see intermittent failures on devices that are created by this file, check to see if you have multiple suites
// running at the same time because one test run could be accidentally destroying devices created by a different test run.
Expand Down Expand Up @@ -78,15 +79,9 @@ internal static async Task ActivateFaultInjectionAsync(

await deviceClient.SendTelemetryAsync(faultInjectionMessage, linkedCts.Token).ConfigureAwait(false);
}
catch (IotHubClientException ex) when (ex.IsTransient || ex.ErrorCode == IotHubClientErrorCode.ConnectionForcefullyClosedOnFaultInjection)
catch (IotHubClientException ex) when (ex.IsTransient || ex.InnerException is MqttClientDisconnectedException)
{
VerboseTestLogger.WriteLine($"{nameof(ActivateFaultInjectionAsync)}: {ex}");

// For quota injection, the fault is only seen for the original HTTP request.
if (transportSettings is IotHubClientHttpSettings)
{
throw;
}
}
catch (OperationCanceledException ex) when (transportSettings is IotHubClientMqttSettings)
{
Expand Down
12 changes: 0 additions & 12 deletions iothub/device/src/Exceptions/IotHubClientErrorCode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -153,17 +153,5 @@ public enum IotHubClientErrorCode
/// is invalid.
/// </summary>
IotHubFormatError = 400006,

/// <summary>
/// Used for fault injection, end-to-end testing in the SDK only.
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
ConnectionForcefullyClosedOnFaultInjection = 400029,

/// <summary>
/// Used for fault injection, end-to-end testing in the SDK only.
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
ConnectionRejectedOnFaultInjection = 400030,
}
}
4 changes: 2 additions & 2 deletions iothub/device/src/Microsoft.Azure.Devices.Client.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@
<!--Nuget package dependencies-->
<ItemGroup>
<PackageReference Include="Azure.Core" Version="1.31.0" />
<PackageReference Include="MQTTnet" Version="4.1.2.350" />
<PackageReference Include="Microsoft.Azure.Amqp" Version="2.5.12" />
<PackageReference Include="MQTTnet" Version="4.1.4.563" />
<PackageReference Include="Microsoft.Azure.Amqp" Version="2.6.2" />
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="7.0.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
Expand Down
4 changes: 2 additions & 2 deletions iothub/device/src/Pipeline/MqttTransportHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -439,9 +439,9 @@ public override async Task SendTelemetryAsync(TelemetryMessage message, Cancella

if (message.Properties.ContainsKey("AzIoTHub_FaultOperationType"))
{
// When fualt injection causes this operation to fail, the MQTT layer throws a TaskCanceledException.
// When fault injection causes this operation to fail, the MQTT layer throws a MqttClientDisconnectedException.
// Normally, we don't want that to get to the device app, but for fault injection tests we prefer
// an exception that is not retryable so we'll let this exception slip through.
// an exception that is NOT retryable so we'll let this exception slip through.
throw;
}

Expand Down
2 changes: 1 addition & 1 deletion iothub/service/src/Microsoft.Azure.Devices.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,6 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="Microsoft.Azure.Amqp" Version="2.5.12" />
<PackageReference Include="Microsoft.Azure.Amqp" Version="2.6.2" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@
<!--Nuget package dependencies-->
<ItemGroup>
<PackageReference Include="Azure.Core" Version="1.31.0" />
<PackageReference Include="Microsoft.Azure.Amqp" Version="2.5.12" />
<PackageReference Include="MQTTnet" Version="4.1.2.350" />
<PackageReference Include="Microsoft.Azure.Amqp" Version="2.6.2" />
<PackageReference Include="MQTTnet" Version="4.1.4.563" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="7.0.1">
<PrivateAssets>all</PrivateAssets>
Expand Down

0 comments on commit ec9441e

Please sign in to comment.