Skip to content

Commit

Permalink
* Sending errors as heartbeats and keyframes
Browse files Browse the repository at this point in the history
* Improve synchronization between writer and subscription handle
* Fix Connectivity status
* Leverage ability to inherit stack resources instead of linking
* Update dependencies and .net stack to 116-preview
  • Loading branch information
marcschier committed Jan 8, 2024
1 parent cf5d93e commit abd8dbd
Show file tree
Hide file tree
Showing 62 changed files with 1,935 additions and 1,750 deletions.
4 changes: 2 additions & 2 deletions common.props
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@
<!--<TreatWarningsAsErrors>true</TreatWarningsAsErrors>-->
</PropertyGroup>
<ItemGroup Condition="$(NO_RCS) == ''">
<PackageReference Include="Roslynator.Analyzers" Version="4.7.0" PrivateAssets="All"/>
<PackageReference Include="Roslynator.Formatting.Analyzers" Version="4.7.0" PrivateAssets="All"/>
<PackageReference Include="Roslynator.Analyzers" Version="4.8.0" PrivateAssets="All"/>
<PackageReference Include="Roslynator.Formatting.Analyzers" Version="4.8.0" PrivateAssets="All"/>
</ItemGroup>
<!-- only create the SARIF files for the SDL build step in cloud builds -->
<PropertyGroup Condition="'$(NBGV_NugetPackageVersion)' != ''">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="Microsoft.Azure.Devices" Version="1.39.0" />
<PackageReference Include="Microsoft.Azure.Devices" Version="1.39.1" />
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="8.0.0" />
<PackageReference Include="SSH.NET" Version="2023.0.0" />
<PackageReference Include="SSH.NET" Version="2023.0.1" />
<PackageReference Include="RestSharp" Version="110.2.0" />
<PackageReference Include="xunit" Version="2.6.3" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.5">
<PackageReference Include="xunit" Version="2.6.4" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.6">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@
<PackageReference Include="Microsoft.Azure.Management.Fluent" Version="1.38.1" />
<PackageReference Include="Azure.ResourceManager" Version="1.9.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="Microsoft.Azure.Devices" Version="1.39.0" />
<PackageReference Include="Microsoft.Azure.Devices" Version="1.39.1" />
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="8.0.0" />
<PackageReference Include="SSH.NET" Version="2023.0.0" />
<PackageReference Include="SSH.NET" Version="2023.0.1" />
<PackageReference Include="System.Linq.Async" Version="6.0.1" />
<PackageReference Include="xunit" Version="2.6.3" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.5">
<PackageReference Include="xunit" Version="2.6.4" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.6">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
Expand Down
4 changes: 2 additions & 2 deletions samples/Http/BrowseAll/BrowseAll.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<Compile Include="..\Parameters.cs"/>
<Compile Include="..\Parameters.cs" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Azure.Devices" Version="1.39.0" />
<PackageReference Include="Microsoft.Azure.Devices" Version="1.39.1" />
<PackageReference Include="CommandLineParser" Version="2.9.1" />
</ItemGroup>
</Project>
4 changes: 2 additions & 2 deletions samples/Http/GetConfiguration/GetConfiguration.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<Compile Include="..\Parameters.cs"/>
<Compile Include="..\Parameters.cs" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Azure.Devices" Version="1.39.0" />
<PackageReference Include="Microsoft.Azure.Devices" Version="1.39.1" />
<PackageReference Include="CommandLineParser" Version="2.9.1" />
</ItemGroup>
</Project>
4 changes: 2 additions & 2 deletions samples/Http/ReadCurrentTime/ReadCurrentTime.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<Compile Include="..\Parameters.cs"/>
<Compile Include="..\Parameters.cs" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Azure.Devices" Version="1.39.0" />
<PackageReference Include="Microsoft.Azure.Devices" Version="1.39.1" />
<PackageReference Include="CommandLineParser" Version="2.9.1" />
</ItemGroup>
</Project>
4 changes: 2 additions & 2 deletions samples/Http/SetConfiguration/SetConfiguration.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<Compile Include="..\Parameters.cs"/>
<Compile Include="..\Parameters.cs" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Azure.Devices" Version="1.39.0" />
<PackageReference Include="Microsoft.Azure.Devices" Version="1.39.1" />
<PackageReference Include="CommandLineParser" Version="2.9.1" />
</ItemGroup>
</Project>
4 changes: 2 additions & 2 deletions samples/Http/WriteReadbackValue/WriteReadbackValue.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<Compile Include="..\Parameters.cs"/>
<Compile Include="..\Parameters.cs" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Azure.Devices" Version="1.39.0" />
<PackageReference Include="Microsoft.Azure.Devices" Version="1.39.1" />
<PackageReference Include="CommandLineParser" Version="2.9.1" />
</ItemGroup>
</Project>
4 changes: 2 additions & 2 deletions samples/IoTHub/ApproveRejected/ApproveRejected.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<Compile Include="..\Parameters.cs"/>
<Compile Include="..\Parameters.cs" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Azure.Devices" Version="1.39.0" />
<PackageReference Include="Microsoft.Azure.Devices" Version="1.39.1" />
<PackageReference Include="CommandLineParser" Version="2.9.1" />
</ItemGroup>
</Project>
4 changes: 2 additions & 2 deletions samples/IoTHub/BrowseCertificates/BrowseCertificates.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<Compile Include="..\Parameters.cs"/>
<Compile Include="..\Parameters.cs" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Azure.Devices" Version="1.39.0" />
<PackageReference Include="Microsoft.Azure.Devices" Version="1.39.1" />
<PackageReference Include="CommandLineParser" Version="2.9.1" />
</ItemGroup>
</Project>
4 changes: 2 additions & 2 deletions samples/IoTHub/GetCertificate/GetApplicationCert.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<Compile Include="..\Parameters.cs"/>
<Compile Include="..\Parameters.cs" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Azure.Devices" Version="1.39.0" />
<PackageReference Include="Microsoft.Azure.Devices" Version="1.39.1" />
<PackageReference Include="CommandLineParser" Version="2.9.1" />
</ItemGroup>
</Project>
4 changes: 2 additions & 2 deletions samples/IoTHub/GetConfiguration/GetConfiguration.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<Compile Include="..\Parameters.cs"/>
<Compile Include="..\Parameters.cs" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Azure.Devices" Version="1.39.0" />
<PackageReference Include="Microsoft.Azure.Devices" Version="1.39.1" />
<PackageReference Include="CommandLineParser" Version="2.9.1" />
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion samples/IoTHub/MonitorMessages/MonitorMessages.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Azure.Messaging.EventHubs" Version="5.10.0" />
<PackageReference Include="Microsoft.Azure.Devices" Version="1.39.0" />
<PackageReference Include="Microsoft.Azure.Devices" Version="1.39.1" />
<PackageReference Include="CommandLineParser" Version="2.9.1" />
</ItemGroup>
</Project>
4 changes: 2 additions & 2 deletions samples/IoTHub/ReadCurrentTime/ReadCurrentTime.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<Compile Include="..\Parameters.cs"/>
<Compile Include="..\Parameters.cs" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Azure.Devices" Version="1.39.0" />
<PackageReference Include="Microsoft.Azure.Devices" Version="1.39.1" />
<PackageReference Include="CommandLineParser" Version="2.9.1" />
</ItemGroup>
</Project>
4 changes: 2 additions & 2 deletions samples/IoTHub/WriteReadbackValue/WriteReadbackValue.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<Compile Include="..\Parameters.cs"/>
<Compile Include="..\Parameters.cs" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Azure.Devices" Version="1.39.0" />
<PackageReference Include="Microsoft.Azure.Devices" Version="1.39.1" />
<PackageReference Include="CommandLineParser" Version="2.9.1" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,28 @@ public record class WriterGroupDiagnosticModel
EmitDefaultValue = true)]
public double MinPublishRequestsRatio { get; set; }

/// <summary>
/// Number of endpoints connected
/// </summary>
[DataMember(Name = "NumberOfConnectedEndpoints", Order = 36,
EmitDefaultValue = true)]
public int NumberOfConnectedEndpoints { get; set; }

/// <summary>
/// Number of endpoints disconnected
/// </summary>
[DataMember(Name = "NumberOfDisconnectedEndpoints", Order = 37,
EmitDefaultValue = true)]
public int NumberOfDisconnectedEndpoints { get; set; }

/// <summary>
/// Number values or events that were not assignable to
/// the items in the subscription.
/// </summary>
[DataMember(Name = "IngressUnassignedChanges", Order = 38,
EmitDefaultValue = true)]
public long IngressUnassignedChanges { get; set; }

/// <summary>
/// Publisher version
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="xunit" Version="2.6.4" />
<PackageReference Include="xunit" Version="2.6.5" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.6">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,14 @@
<PackageReference Include="Furly.Extensions.Dapr" Version="1.0.18" />
<PackageReference Include="Furly.Extensions.MessagePack" Version="1.0.18" />
<PackageReference Include="Furly.Tunnel" Version="1.0.18" />
<PackageReference Include="Grpc.Net.Client" Version="2.59.0" />
<PackageReference Include="Mono.Options" Version="6.12.0.148" />
<PackageReference Include="OpenTelemetry.Extensions.Hosting" Version="1.7.0" />
<PackageReference Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="1.7.0" />
<PackageReference Include="OpenTelemetry.Exporter.Prometheus.AspNetCore" Version="1.7.0-rc.1" />
<PackageReference Include="OpenTelemetry.Exporter.Console" Version="1.7.0" />
<PackageReference Include="OpenTelemetry.Instrumentation.Http" Version="1.7.0" />
<PackageReference Include="OpenTelemetry.Instrumentation.AspNetCore" Version="1.7.0" />
<PackageReference Include="OpenTelemetry.Instrumentation.Runtime" Version="1.5.1" />
<PackageReference Include="OpenTelemetry.Instrumentation.Runtime" Version="1.7.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Azure.IIoT.OpcUa.Publisher\src\Azure.IIoT.OpcUa.Publisher.csproj" />
Expand Down
1 change: 0 additions & 1 deletion src/Azure.IIoT.OpcUa.Publisher.Module/src/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ namespace Azure.IIoT.OpcUa.Publisher.Module
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Azure.IIoT.OpcUa.Publisher.Stack.Runtime;

/// <summary>
/// Module
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="Moq" Version="[4.20.2]" />
<PackageReference Include="Divergic.Logging.Xunit" Version="4.3.0" />
<PackageReference Include="xunit" Version="2.6.4" />
<PackageReference Include="xunit" Version="2.6.5" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.6">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -312,11 +312,11 @@ public async Task RestartConfigurationTest()
const string name2 = nameof(RestartConfigurationTest) + "new";
WritePublishedNodes(name2, "./Resources/DataItems2.json");
var diagnostics = await PublisherApi.GetDiagnosticInfoAsync();
for (var i = 0; i < 10 &&
for (var i = 0; i < 12 &&
(diagnostics.Count != 1 || diagnostics[0].Endpoint.DataSetWriterGroup != name2); i++)
{
_output.WriteLine($"######### {i}: Failed to get diagnosticsinfo.");
await Task.Delay(1000);
await Task.Delay(5000);
diagnostics = await PublisherApi.GetDiagnosticInfoAsync();
}
var diag = Assert.Single(diagnostics);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ public async Task CanSendHeartbeatToIoTHubTest(MessageTimestamp timestamp, Heart
Assert.NotEmpty(message.GetProperty("ApplicationUri").GetString());
Assert.NotEmpty(message.GetProperty("Timestamp").GetString());
Assert.True(message.GetProperty("SequenceNumber").GetUInt32() > 0);
_output.WriteLine(message.ToJsonString());
Assert.Equal("en-US", message.GetProperty("Value").GetProperty("Value").EnumerateArray().First().GetString());

var timestamps = new HashSet<DateTime> { message.GetProperty("Timestamp").GetDateTime() };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<PackageReference Include="OpenTelemetry.Exporter.Prometheus.AspNetCore" Version="1.7.0-rc.1" />
<PackageReference Include="OpenTelemetry.Exporter.Console" Version="1.7.0" />
<PackageReference Include="OpenTelemetry.Instrumentation.AspNetCore" Version="1.7.0" />
<PackageReference Include="OpenTelemetry.Instrumentation.Runtime" Version="1.5.1" />
<PackageReference Include="OpenTelemetry.Instrumentation.Runtime" Version="1.7.0" />
<PackageReference Include="Furly.Extensions.AspNetCore" Version="1.0.18" />
<PackageReference Include="Furly.Extensions.MessagePack" Version="1.0.18" />
<PackageReference Include="Furly.Azure.KeyVault" Version="1.0.18" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="Divergic.Logging.Xunit" Version="4.3.0" />
<PackageReference Include="xRetry" Version="1.9.0" />
<PackageReference Include="xunit" Version="2.6.4" />
<PackageReference Include="xunit" Version="2.6.5" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.6">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Divergic.Logging.Xunit" Version="4.3.0" />
<PackageReference Include="xunit" Version="2.6.4" />
<PackageReference Include="xunit" Version="2.6.5" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.6">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,6 @@
<ItemGroup>
<PackageReference Include="Furly.Extensions" Version="1.0.18" />
<PackageReference Include="System.Linq.Async" Version="6.0.1" />
<PackageReference Include="OPCFoundation.NetStandard.Opc.Ua.Server" Version="1.4.372.106" />
<PackageReference Include="OPCFoundation.NetStandard.Opc.Ua.Server" Version="1.4.372.116-preview" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="8.0.0" />
<PackageReference Include="FluentAssertions" Version="6.12.0" />
<PackageReference Include="Moq" Version="[4.20.2]" />
<PackageReference Include="xunit.assert" Version="2.6.4" />
<PackageReference Include="xunit.assert" Version="2.6.5" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Azure.IIoT.OpcUa.Publisher\src\Azure.IIoT.OpcUa.Publisher.csproj" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
<PackageReference Include="Nito.AsyncEx" Version="5.1.2" />
<PackageReference Include="Furly.Azure.IoT.Edge" Version="1.0.18" />
<PackageReference Include="Irony" Version="1.2.0" />
<PackageReference Include="OPCFoundation.NetStandard.Opc.Ua.Client.ComplexTypes" Version="1.4.372.106" />
<PackageReference Include="OPCFoundation.NetStandard.Opc.Ua.Client" Version="1.4.372.106" />
<PackageReference Include="OPCFoundation.NetStandard.Opc.Ua.Client.ComplexTypes" Version="1.4.372.116-preview" />
<PackageReference Include="OPCFoundation.NetStandard.Opc.Ua.Client" Version="1.4.372.116-preview" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Azure.IIoT.OpcUa\src\Azure.IIoT.OpcUa.csproj" />
Expand Down
2 changes: 1 addition & 1 deletion src/Azure.IIoT.OpcUa.Publisher/src/IMessageSource.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ namespace Azure.IIoT.OpcUa.Publisher
/// <summary>
/// Writer group
/// </summary>
public interface IMessageSource : IAsyncDisposable
public interface IMessageSource : IDisposable
{
/// <summary>
/// Subscribe to writer messages
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
namespace Azure.IIoT.OpcUa.Publisher
{
using Azure.IIoT.OpcUa.Publisher.Models;
using Azure.IIoT.OpcUa.Publisher.Stack.Runtime;
using Furly.Extensions.Configuration;
using Furly.Extensions.Hosting;
using Furly.Extensions.Messaging;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ public async ValueTask DisposeAsync()
finally
{
_diagnostics?.Dispose();
await Source.DisposeAsync().ConfigureAwait(false);
Source.Dispose();
}
}

Expand Down
Loading

0 comments on commit abd8dbd

Please sign in to comment.