Skip to content
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
6 changes: 3 additions & 3 deletions src/Messaging/API/ConnectionErrorArgs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@
* limitations under the License.
*/

using RabbitMQ.Client;

namespace Monai.Deploy.Messaging.API
{
public delegate void ConnectionErrorHandler(object? sender, ConnectionErrorArgs args);

public class ConnectionErrorArgs
{
public ConnectionErrorArgs(ShutdownEventArgs eventArgs) => ShutdownEventArguments = eventArgs ?? throw new ArgumentNullException(nameof(eventArgs));
public ConnectionErrorArgs() => ErrorMessage = string.Empty;
public ConnectionErrorArgs(string errorMessage) => ErrorMessage = errorMessage;

public ShutdownEventArgs ShutdownEventArguments { get; }
public string ErrorMessage { get; }
}
}
6 changes: 3 additions & 3 deletions src/Messaging/Events/ExportCompleteEvent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ public ExportCompleteEvent()

public ExportCompleteEvent(ExportRequestEvent exportRequest, ExportStatus exportStatus, Dictionary<string, FileExportStatus> fileStatuses)
{
Guard.Against.Null(exportRequest, nameof(exportRequest));
Guard.Against.Null(exportStatus, nameof(exportStatus));
Guard.Against.Null(fileStatuses, nameof(fileStatuses));
Guard.Against.Null(exportRequest);
Guard.Against.Null(exportStatus);
Guard.Against.Null(fileStatuses);

WorkflowInstanceId = exportRequest.WorkflowInstanceId;
ExportTaskId = exportRequest.ExportTaskId;
Expand Down
1 change: 0 additions & 1 deletion src/Messaging/Monai.Deploy.Messaging.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@
<PackageReference Include="Microsoft.Extensions.Diagnostics.HealthChecks" Version="6.0.10" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="6.0.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="RabbitMQ.Client" Version="6.4.0" />
<PackageReference Include="System.ComponentModel.Annotations" Version="5.0.0" />
<PackageReference Include="System.IO.Abstractions" Version="17.2.3" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@

<ItemGroup>
<PackageReference Include="Polly" Version="7.2.3" />
<PackageReference Include="RabbitMQ.Client" Version="6.4.0" />
<PackageReference Include="System.Collections.Concurrent" Version="4.3.0" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public RabbitMQMessagePublisherService(IOptions<MessageBrokerServiceConfiguratio
ILogger<RabbitMQMessagePublisherService> logger,
IRabbitMQConnectionFactory rabbitMqConnectionFactory)
{
Guard.Against.Null(options, nameof(options));
Guard.Against.Null(options);

_logger = logger ?? throw new ArgumentNullException(nameof(logger));
_rabbitMqConnectionFactory = rabbitMqConnectionFactory ?? throw new ArgumentNullException(nameof(rabbitMqConnectionFactory));
Expand Down Expand Up @@ -82,7 +82,7 @@ public RabbitMQMessagePublisherService(IOptions<MessageBrokerServiceConfiguratio

internal static void ValidateConfiguration(Dictionary<string, string> configuration)
{
Guard.Against.Null(configuration, nameof(configuration));
Guard.Against.Null(configuration);

foreach (var key in ConfigurationKeys.PublisherRequiredKeys)
{
Expand All @@ -95,8 +95,8 @@ internal static void ValidateConfiguration(Dictionary<string, string> configurat

public Task Publish(string topic, Message message)
{
Guard.Against.NullOrWhiteSpace(topic, nameof(topic));
Guard.Against.Null(message, nameof(message));
Guard.Against.NullOrWhiteSpace(topic);
Guard.Against.Null(message);

using var loggingScope = _logger.BeginScope(new Dictionary<string, object>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ private void Channel_ModelShutdown(object? sender, ShutdownEventArgs e)
if (OnConnectionError is not null)
{
_logger.NotifyModelShutdown(e.ToString());
OnConnectionError(sender, new ConnectionErrorArgs(e));
OnConnectionError(sender, new ConnectionErrorArgs(e.ToString()));
}
}
else
Expand Down