Skip to content

Queue logic updates #107

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Aug 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion docs/setup/schema.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,10 @@ The `InformaticsGateway` configuration section contains the following sub-sectio
"password": "password",
"virtualHost": "monaideploy",
"exchange": "monaideploy",
"exportRequestQueue": "export_tasks"
"exportRequestQueue": "export_tasks",
"deadLetterExchange": "monaideploy-dead-letter",
"deliveryLimit": 3,
"requeueDelay": 30
}
},
"storage": {
Expand Down
2 changes: 1 addition & 1 deletion src/.sonarlint/Monai.Deploy.InformaticsGateway.slconfig
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"Profiles": {
"CSharp": {
"ProfileKey": "AX96ONQSnTk2GEVJ9ILJ",
"ProfileTimestamp": "2021-11-22T10:44:23Z"
"ProfileTimestamp": "2022-07-05T10:19:10Z"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
<Rule Id="S2201" Action="Warning" />
<Rule Id="S2219" Action="Info" />
<Rule Id="S2221" Action="None" />
<Rule Id="S2222" Action="None" />
<Rule Id="S2222" Action="Warning" />
<Rule Id="S2223" Action="Warning" />
<Rule Id="S2225" Action="Warning" />
<Rule Id="S2228" Action="None" />
Expand Down Expand Up @@ -362,6 +362,12 @@
<Rule Id="S5659" Action="Warning" />
<Rule Id="S5773" Action="Warning" />
<Rule Id="S6354" Action="None" />
<Rule Id="S6419" Action="Warning" />
<Rule Id="S6420" Action="Warning" />
<Rule Id="S6421" Action="None" />
<Rule Id="S6422" Action="Warning" />
<Rule Id="S6423" Action="None" />
<Rule Id="S6424" Action="Warning" />
<Rule Id="S818" Action="Info" />
<Rule Id="S881" Action="None" />
<Rule Id="S907" Action="Warning" />
Expand Down
1 change: 1 addition & 0 deletions src/.sonarlint/sonar.settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"sonar.exclusions":[],"sonar.global.exclusions":["**/build-wrapper-dump.json"],"sonar.inclusions":[]}
6 changes: 3 additions & 3 deletions src/Api/Monai.Deploy.InformaticsGateway.Api.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@
<PrivateAssets>All</PrivateAssets>
</PackageReference>
<PackageReference Include="Macross.Json.Extensions" Version="3.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Abstractions" Version="6.0.6" />
<PackageReference Include="Monai.Deploy.Messaging" Version="0.1.2" />
<PackageReference Include="Monai.Deploy.Storage" Version="0.1.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Abstractions" Version="6.0.7" />
<PackageReference Include="Monai.Deploy.Messaging" Version="0.1.3-rc0010" />
<PackageReference Include="Monai.Deploy.Storage" Version="0.2.0-rc0012" />
<PackageReference Include="System.ComponentModel.Annotations" Version="5.0.0" />
</ItemGroup>

Expand Down
4 changes: 2 additions & 2 deletions src/Api/Test/Monai.Deploy.InformaticsGateway.Api.Test.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!--
<!--
~ Copyright 2021-2022 MONAI Consortium
~
~ Licensed under the Apache License, Version 2.0 (the "License");
Expand Down Expand Up @@ -33,7 +33,7 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.2.0" />
<PackageReference Include="System.IO.Abstractions.TestingHelpers" Version="17.0.18" />
<PackageReference Include="System.IO.Abstractions.TestingHelpers" Version="17.0.24" />
<PackageReference Include="xRetry" Version="1.8.0" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
Expand Down
4 changes: 2 additions & 2 deletions src/CLI/Monai.Deploy.InformaticsGateway.CLI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@

<ItemGroup>
<PackageReference Include="Crayon" Version="2.0.64" />
<PackageReference Include="Docker.DotNet" Version="3.125.5" />
<PackageReference Include="Docker.DotNet" Version="3.125.10" />
<PackageReference Include="GitVersion.MsBuild" Version="5.10.3">
<PrivateAssets>All</PrivateAssets>
</PackageReference>
Expand All @@ -62,6 +62,6 @@
<PackageReference Include="System.CommandLine" Version="2.0.0-beta4.22272.1" />
<PackageReference Include="System.CommandLine.Hosting" Version="0.4.0-alpha.22272.1" />
<PackageReference Include="System.CommandLine.Rendering" Version="0.4.0-alpha.22272.1" />
<PackageReference Include="System.IO.Abstractions" Version="17.0.18" />
<PackageReference Include="System.IO.Abstractions" Version="17.0.24" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.2.0" />
<PackageReference Include="Moq" Version="4.18.1" />
<PackageReference Include="System.CommandLine.Hosting" Version="0.4.0-alpha.22272.1" />
<PackageReference Include="System.IO.Abstractions.TestingHelpers" Version="17.0.18" />
<PackageReference Include="System.IO.Abstractions.TestingHelpers" Version="17.0.24" />
<PackageReference Include="xRetry" Version="1.8.0" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
Expand Down
4 changes: 2 additions & 2 deletions src/Common/Monai.Deploy.InformaticsGateway.Common.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!--
<!--
~ Copyright 2021-2022 MONAI Consortium
~
~ Licensed under the Apache License, Version 2.0 (the "License");
Expand Down Expand Up @@ -32,7 +32,7 @@
<PackageReference Include="GitVersion.MsBuild" Version="5.10.3">
<PrivateAssets>All</PrivateAssets>
</PackageReference>
<PackageReference Include="System.IO.Abstractions" Version="17.0.18" />
<PackageReference Include="System.IO.Abstractions" Version="17.0.24" />
<PackageReference Include="System.Threading.Tasks.Dataflow" Version="6.0.0" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!--
<!--
~ Copyright 2021-2022 MONAI Consortium
~
~ Licensed under the Apache License, Version 2.0 (the "License");
Expand Down Expand Up @@ -30,7 +30,7 @@
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.2.0" />
<PackageReference Include="Moq" Version="4.18.1" />
<PackageReference Include="System.IO.Abstractions.TestingHelpers" Version="17.0.18" />
<PackageReference Include="System.IO.Abstractions.TestingHelpers" Version="17.0.24" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@
</PackageReference>
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="6.0.1" />
<PackageReference Include="Microsoft.Extensions.Options" Version="6.0.0" />
<PackageReference Include="Monai.Deploy.Messaging" Version="0.1.2" />
<PackageReference Include="Monai.Deploy.Storage" Version="0.1.1" />
<PackageReference Include="System.IO.Abstractions" Version="17.0.18" />
<PackageReference Include="Monai.Deploy.Messaging" Version="0.1.3-rc0010" />
<PackageReference Include="Monai.Deploy.Storage" Version="0.2.0-rc0012" />
<PackageReference Include="System.IO.Abstractions" Version="17.0.24" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.2.0" />
<PackageReference Include="Moq" Version="4.18.1" />
<PackageReference Include="System.IO.Abstractions.TestingHelpers" Version="17.0.18" />
<PackageReference Include="System.IO.Abstractions.TestingHelpers" Version="17.0.24" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
Expand Down
6 changes: 3 additions & 3 deletions src/Database/Monai.Deploy.InformaticsGateway.Database.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@
<PackageReference Include="GitVersion.MsBuild" Version="5.10.3">
<PrivateAssets>All</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="6.0.6" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="6.0.6">
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="6.0.7" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="6.0.7">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="6.0.6" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="6.0.7" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="6.0.1" />
<PackageReference Include="Microsoft.Extensions.Configuration.FileExtensions" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="6.0.0" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@

<Project Sdk="Microsoft.NET.Sdk">

<ItemGroup>
<AdditionalFiles Include="..\..\.sonarlint\project-monai_monai-deploy-informatics-gateway\CSharp\SonarLint.xml" Link="SonarLint.xml" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\Client.Common\Monai.Deploy.InformaticsGateway.Client.Common.csproj" />
<ProjectReference Include="..\Monai.Deploy.InformaticsGateway.DicomWeb.Client.csproj" />
Expand All @@ -22,14 +26,15 @@
<AssemblyName>dicomweb-cli</AssemblyName>
<PublishTrimmed>true</PublishTrimmed>
<PublishReadyToRun>true</PublishReadyToRun>
<CodeAnalysisRuleSet>..\..\.sonarlint\project-monai_monai-deploy-informatics-gatewaycsharp.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<Optimize>true</Optimize>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="ConsoleAppFramework" Version="4.1.0" />
<PackageReference Include="ConsoleAppFramework" Version="4.2.2" />
<PackageReference Include="fo-dicom" Version="5.0.2" />
<PackageReference Include="Microsoft.Extensions.Http" Version="6.0.0" />
</ItemGroup>
Expand Down
12 changes: 6 additions & 6 deletions src/InformaticsGateway/Monai.Deploy.InformaticsGateway.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!--
<!--
~ Copyright 2022 MONAI Consortium
~
~ Licensed under the Apache License, Version 2.0 (the "License");
Expand Down Expand Up @@ -33,21 +33,21 @@

<ItemGroup>
<PackageReference Include="Ardalis.GuardClauses" Version="4.0.1" />
<PackageReference Include="DotNext.Threading" Version="4.6.0" />
<PackageReference Include="DotNext.Threading" Version="4.6.1" />
<PackageReference Include="fo-dicom" Version="5.0.2" />
<PackageReference Include="Karambolo.Extensions.Logging.File" Version="3.3.0" />
<PackageReference Include="Karambolo.Extensions.Logging.File" Version="3.3.1" />
<PackageReference Include="GitVersion.MsBuild" Version="5.10.3">
<PrivateAssets>All</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="6.0.6" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="6.0.7" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="6.0.1" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Options" Version="6.0.0" />
<PackageReference Include="Monai.Deploy.Storage" Version="0.1.1" />
<PackageReference Include="Monai.Deploy.Storage" Version="0.2.0-rc0012" />
<PackageReference Include="Polly" Version="7.2.3" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.3.1" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.4.0" />
</ItemGroup>

<ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions src/InformaticsGateway/Services/Export/ExportServiceBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ public Task StopAsync(CancellationToken cancellationToken)

private void SetupPolling()
{
_messageSubscriber.Subscribe(RoutingKey, String.Empty, OnMessageReceivedCallback);
_messageSubscriber.Subscribe(RoutingKey, RoutingKey, OnMessageReceivedCallback);
_logger.ExportEventSubscription(ServiceName, RoutingKey);
}

Expand All @@ -127,7 +127,7 @@ private void OnMessageReceivedCallback(MessageReceivedEventArgs eventArgs)
if (!_storageInfoProvider.HasSpaceAvailableForExport)
{
_logger.ExportPausedDueToInsufficientStorageSpace(ServiceName, _storageInfoProvider.AvailableFreeSpace);
_messageSubscriber.Reject(eventArgs.Message);
_messageSubscriber.RequeueWithDelay(eventArgs.Message);
return;
}

Expand Down
1 change: 1 addition & 0 deletions src/InformaticsGateway/Test/DummyMessagingService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ internal class DummyMessagingService : IMessageBrokerPublisherService, IMessageB
public void Dispose() => throw new NotImplementedException();
public Task Publish(string topic, Message message) => throw new NotImplementedException();
public void Reject(MessageBase message, bool requeue = true) => throw new NotImplementedException();
public Task RequeueWithDelay(MessageBase message) => throw new NotImplementedException();
public void Subscribe(string topic, string queue, Action<MessageReceivedEventArgs> messageReceivedCallback, ushort prefetchCount = 0) => throw new NotImplementedException();
public void Subscribe(string[] topics, string queue, Action<MessageReceivedEventArgs> messageReceivedCallback, ushort prefetchCount = 0) => throw new NotImplementedException();
public void SubscribeAsync(string topic, string queue, Func<MessageReceivedEventArgs, Task> messageReceivedCallback, ushort prefetchCount = 0) => throw new NotImplementedException();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,18 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.AspNetCore.Mvc.WebApiCompatShim" Version="2.2.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="6.0.6" />
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="6.0.7" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.2.0" />
<PackageReference Include="Moq" Version="4.18.1" />
<PackageReference Include="NPOI" Version="2.5.6" />
<PackageReference Include="System.IO.Abstractions.TestingHelpers" Version="17.0.18" />
<PackageReference Include="System.IO.Abstractions.TestingHelpers" Version="17.0.24" />
<PackageReference Include="xRetry" Version="1.8.0" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.3.1" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.4.0" />
</ItemGroup>

<ItemGroup>
Expand Down
Loading