diff --git a/.gitignore b/.gitignore
index e98952029..37731856c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -672,3 +672,4 @@ fabric.properties
**/wwwroot/bundled
ocelot.json
/src/2-Services/Identity/Api/Identity.Api/keys
+/src/6-Docker/mssqldata/Entropy.bin
diff --git a/src/1-BuildingBlocks/Application/Behaviors/BehaviorsExtensions.cs b/src/1-BuildingBlocks/Application/Behaviors/BehaviorExtensions.cs
similarity index 97%
rename from src/1-BuildingBlocks/Application/Behaviors/BehaviorsExtensions.cs
rename to src/1-BuildingBlocks/Application/Behaviors/BehaviorExtensions.cs
index 0129b7c7e..398ec42ba 100644
--- a/src/1-BuildingBlocks/Application/Behaviors/BehaviorsExtensions.cs
+++ b/src/1-BuildingBlocks/Application/Behaviors/BehaviorExtensions.cs
@@ -6,7 +6,7 @@
namespace TaskoMask.BuildingBlocks.Application.Behaviors
{
- public static class BehaviorsExtensions
+ public static class BehaviorExtensions
{
diff --git a/src/1-BuildingBlocks/Application/Exceptions/ApplicationException.cs b/src/1-BuildingBlocks/Application/Exceptions/ApplicationException.cs
index 22e0d0324..8df37d759 100644
--- a/src/1-BuildingBlocks/Application/Exceptions/ApplicationException.cs
+++ b/src/1-BuildingBlocks/Application/Exceptions/ApplicationException.cs
@@ -1,4 +1,4 @@
-using TaskoMask.BuildingBlocks.Domain.Exceptions;
+using TaskoMask.BuildingBlocks.Contracts.Exceptions;
namespace TaskoMask.BuildingBlocks.Application.Exceptions
{
@@ -6,7 +6,7 @@ namespace TaskoMask.BuildingBlocks.Application.Exceptions
///
///
///
- public class ApplicationException : DomainException
+ public class ApplicationException : ManagedException
{
#region Ctors
diff --git a/src/1-BuildingBlocks/Application/Exceptions/ExceptionExtensions.cs b/src/1-BuildingBlocks/Application/Exceptions/ExceptionExtensions.cs
new file mode 100644
index 000000000..f5f6c3840
--- /dev/null
+++ b/src/1-BuildingBlocks/Application/Exceptions/ExceptionExtensions.cs
@@ -0,0 +1,38 @@
+using MediatR.Pipeline;
+using Microsoft.Extensions.DependencyInjection;
+
+namespace TaskoMask.BuildingBlocks.Application.Exceptions
+{
+ public static class ExceptionExtensions
+ {
+
+ ///
+ ///
+ ///
+ public static void AddApplicationExceptionHandlers(this IServiceCollection services)
+ {
+ services.AddManagedExceptionsHandler();
+ services.AddUnmanagedExceptionsHandler();
+ }
+
+
+
+ ///
+ ///
+ ///
+ private static void AddManagedExceptionsHandler(this IServiceCollection services)
+ {
+ services.AddScoped(typeof(IRequestExceptionHandler<,,>), typeof(ManagedExceptionHandler<,,>));
+ }
+
+
+ ///
+ ///
+ ///
+ private static void AddUnmanagedExceptionsHandler(this IServiceCollection services)
+ {
+ services.AddScoped(typeof(IRequestExceptionHandler<,,>), typeof(UnmanagedExceptionHandler<,,>));
+ }
+
+ }
+}
diff --git a/src/1-BuildingBlocks/Application/Exceptions/ExceptionsExtensions.cs b/src/1-BuildingBlocks/Application/Exceptions/ExceptionsExtensions.cs
deleted file mode 100644
index fddd7933a..000000000
--- a/src/1-BuildingBlocks/Application/Exceptions/ExceptionsExtensions.cs
+++ /dev/null
@@ -1,17 +0,0 @@
-using MediatR.Pipeline;
-using Microsoft.Extensions.DependencyInjection;
-
-namespace TaskoMask.BuildingBlocks.Application.Exceptions
-{
- public static class ExceptionsExtensions
- {
-
- ///
- ///
- ///
- public static void AddApplicationExceptionsHandler(this IServiceCollection services)
- {
- services.AddScoped(typeof(IRequestExceptionHandler<,,>), typeof(ApplicationExceptionsHandler<,,>));
- }
- }
-}
diff --git a/src/1-BuildingBlocks/Application/Exceptions/ApplicationExceptionsHandler.cs b/src/1-BuildingBlocks/Application/Exceptions/ManagedExceptionHandler.cs
similarity index 58%
rename from src/1-BuildingBlocks/Application/Exceptions/ApplicationExceptionsHandler.cs
rename to src/1-BuildingBlocks/Application/Exceptions/ManagedExceptionHandler.cs
index ef535686f..2d71c15c3 100644
--- a/src/1-BuildingBlocks/Application/Exceptions/ApplicationExceptionsHandler.cs
+++ b/src/1-BuildingBlocks/Application/Exceptions/ManagedExceptionHandler.cs
@@ -1,39 +1,39 @@
using TaskoMask.BuildingBlocks.Application.Notifications;
-using MediatR;
using MediatR.Pipeline;
using System.Threading;
using System.Threading.Tasks;
-using TaskoMask.BuildingBlocks.Domain.Exceptions;
+using Microsoft.Extensions.Logging;
+using TaskoMask.BuildingBlocks.Contracts.Exceptions;
+using System.Text.Json;
namespace TaskoMask.BuildingBlocks.Application.Exceptions
{
///
- ///
+ /// Handle all managed exceptions (DomainException,ApplicationException,ValidationException)
///
- public class ApplicationExceptionsHandler
- : IRequestExceptionHandler where TException : DomainException
+ public class ManagedExceptionHandler
+ : IRequestExceptionHandler where TException : ManagedException
{
#region Fields
private readonly INotificationHandler _notifications;
-
+ private readonly ILogger> _logger;
#endregion
-
#region Ctors
- public ApplicationExceptionsHandler(INotificationHandler notifications)
+ public ManagedExceptionHandler(INotificationHandler notifications, ILogger> logger)
{
_notifications = notifications;
+ this._logger = logger;
}
#endregion
-
#region Handler
@@ -45,25 +45,11 @@ public Task Handle(TRequest request, TException exception, RequestExceptionHandl
{
var exceptionType = exception.GetType();
- //notification exception error message if exist
+ //notify exception message if any
if (!string.IsNullOrEmpty(exception.Message))
_notifications.Add(exceptionType.Name, exception.Message);
-
- if (exceptionType == typeof(ApplicationException))
- {
- //log ApplicationException ...
- }
-
- else if (exceptionType == typeof(ValidationException))
- {
- //log ValidationException ...
- }
-
- else if (exceptionType == typeof(DomainException))
- {
- //log DomainException ...
- }
+ _logger.LogWarning(exception, $"request : {JsonSerializer.Serialize(request)}");
state.SetHandled(default);
diff --git a/src/1-BuildingBlocks/Application/Exceptions/UnmanagedExceptionHandler.cs b/src/1-BuildingBlocks/Application/Exceptions/UnmanagedExceptionHandler.cs
new file mode 100644
index 000000000..891f410fd
--- /dev/null
+++ b/src/1-BuildingBlocks/Application/Exceptions/UnmanagedExceptionHandler.cs
@@ -0,0 +1,58 @@
+using TaskoMask.BuildingBlocks.Application.Notifications;
+using MediatR.Pipeline;
+using System.Threading;
+using System.Threading.Tasks;
+using Microsoft.Extensions.Logging;
+using System;
+using System.Text.Json;
+
+namespace TaskoMask.BuildingBlocks.Application.Exceptions
+{
+ ///
+ /// Handle all unmanaged exceptions
+ ///
+ public class UnmanagedExceptionHandler
+ : IRequestExceptionHandler where TException : Exception
+ {
+ #region Fields
+
+
+ private readonly INotificationHandler _notifications;
+ private readonly ILogger> _logger;
+
+ #endregion
+
+ #region Ctors
+
+
+ public UnmanagedExceptionHandler(INotificationHandler notifications, ILogger> logger)
+ {
+ _notifications = notifications;
+ this._logger = logger;
+ }
+
+
+ #endregion
+
+ #region Handler
+
+
+
+ ///
+ ///
+ ///
+ public Task Handle(TRequest request, TException exception, RequestExceptionHandlerState state, CancellationToken cancellationToken)
+ {
+ _notifications.Add("Unknown Exception", "Unknown exception happened");
+
+ _logger.LogError(exception, $"request : {JsonSerializer.Serialize(request)}");
+
+ state.SetHandled(default);
+
+ return Task.CompletedTask;
+ }
+
+
+ #endregion
+ }
+}
\ No newline at end of file
diff --git a/src/1-BuildingBlocks/Application/Exceptions/ValidationException.cs b/src/1-BuildingBlocks/Application/Exceptions/ValidationException.cs
index f4a3d8df7..4660eebfd 100644
--- a/src/1-BuildingBlocks/Application/Exceptions/ValidationException.cs
+++ b/src/1-BuildingBlocks/Application/Exceptions/ValidationException.cs
@@ -1,4 +1,4 @@
-using TaskoMask.BuildingBlocks.Domain.Exceptions;
+using TaskoMask.BuildingBlocks.Contracts.Exceptions;
namespace TaskoMask.BuildingBlocks.Application.Exceptions
{
@@ -6,7 +6,7 @@ namespace TaskoMask.BuildingBlocks.Application.Exceptions
///
///
///
- public class ValidationException : DomainException
+ public class ValidationException : ManagedException
{
#region Ctors
diff --git a/src/1-BuildingBlocks/Application/Services/ApplicationExtensions.cs b/src/1-BuildingBlocks/Application/Services/ApplicationExtensions.cs
index d7bd06063..3de94d051 100644
--- a/src/1-BuildingBlocks/Application/Services/ApplicationExtensions.cs
+++ b/src/1-BuildingBlocks/Application/Services/ApplicationExtensions.cs
@@ -17,7 +17,7 @@ public static void AddBuildingBlocksApplication(this IServiceCollection services
if (services == null)
throw new ArgumentNullException(nameof(services));
- services.AddApplicationExceptionsHandler();
+ services.AddApplicationExceptionHandlers();
services.AddApplicationBehaviors(validatorAssemblyMarkerType);
services.AddDomainNotificationHandler();
}
diff --git a/src/1-BuildingBlocks/Contracts/Exceptions/DomainException.cs b/src/1-BuildingBlocks/Contracts/Exceptions/DomainException.cs
new file mode 100644
index 000000000..2688e90cf
--- /dev/null
+++ b/src/1-BuildingBlocks/Contracts/Exceptions/DomainException.cs
@@ -0,0 +1,14 @@
+using System;
+namespace TaskoMask.BuildingBlocks.Contracts.Exceptions
+{
+ ///
+ ///
+ ///
+ public class ManagedException : Exception
+ {
+ public ManagedException(string message): base(message)
+ {
+ }
+
+ }
+}
\ No newline at end of file
diff --git a/src/1-BuildingBlocks/Domain/Exceptions/DomainException.cs b/src/1-BuildingBlocks/Domain/Exceptions/DomainException.cs
index 6053b2c4d..6f62180a4 100644
--- a/src/1-BuildingBlocks/Domain/Exceptions/DomainException.cs
+++ b/src/1-BuildingBlocks/Domain/Exceptions/DomainException.cs
@@ -1,10 +1,11 @@
-using System;
+using TaskoMask.BuildingBlocks.Contracts.Exceptions;
+
namespace TaskoMask.BuildingBlocks.Domain.Exceptions
{
///
///
///
- public class DomainException : Exception
+ public class DomainException : ManagedException
{
public DomainException(string message): base(message)
{
diff --git a/src/1-BuildingBlocks/Web.MVC/Configuration/Grpc/GrpcConfiguration.cs b/src/1-BuildingBlocks/Web.MVC/Configuration/Grpc/GrpcConfiguration.cs
new file mode 100644
index 000000000..4b6f62330
--- /dev/null
+++ b/src/1-BuildingBlocks/Web.MVC/Configuration/Grpc/GrpcConfiguration.cs
@@ -0,0 +1,30 @@
+using Microsoft.Extensions.Configuration;
+using Microsoft.Extensions.DependencyInjection;
+using TaskoMask.BuildingBlocks.Web.MVC.Exceptions;
+
+namespace TaskoMask.BuildingBlocks.Web.Grpc.Configuration
+{
+
+ ///
+ ///
+ ///
+ public static class GrpcConfiguration
+ {
+
+
+ ///
+ ///
+ ///
+ public static void AddGrpcPreConfigured(this IServiceCollection services)
+ {
+ if (services == null) throw new ArgumentNullException(nameof(services));
+
+ services.AddGrpc(options =>
+ {
+ options.Interceptors.Add();
+ });
+ }
+
+
+ }
+}
diff --git a/src/1-BuildingBlocks/Web.MVC/Configuration/MVC/WebApiConfiguration.cs b/src/1-BuildingBlocks/Web.MVC/Configuration/MVC/WebApiConfiguration.cs
index e35627f3c..38869116f 100644
--- a/src/1-BuildingBlocks/Web.MVC/Configuration/MVC/WebApiConfiguration.cs
+++ b/src/1-BuildingBlocks/Web.MVC/Configuration/MVC/WebApiConfiguration.cs
@@ -1,9 +1,9 @@
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
-using Microsoft.AspNetCore.Server.Kestrel.Core;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
+using MonoApi.Services.Afrr.Activations.Api.Helpers;
using TaskoMask.BuildingBlocks.Web.MVC.Configuration.Jwt;
using TaskoMask.BuildingBlocks.Web.MVC.Configuration.Swagger;
using TaskoMask.BuildingBlocks.Web.MVC.Services.AuthenticatedUser;
@@ -55,6 +55,9 @@ public static void UseWebApiPreConfigured(this IApplicationBuilder app, IWebHost
if (env.IsDevelopment())
app.UseDeveloperExceptionPage();
+ app.UseGlobalExceptionHandler();
+
+
app.UseSwaggerPreConfigured();
app.UseHttpsRedirection();
@@ -76,12 +79,20 @@ public static void UseWebApiPreConfigured(this IApplicationBuilder app, IWebHost
///
/// Prevent auto validate on model binding
///
- private static IMvcBuilder WithPreventAutoValidation(this IMvcBuilder builder)
+ private static void WithPreventAutoValidation(this IMvcBuilder builder)
{
- return builder.ConfigureApiBehaviorOptions(options =>
+ builder.ConfigureApiBehaviorOptions(options =>
{
options.SuppressModelStateInvalidFilter = true;
});
}
+
+ ///
+ ///
+ ///
+ private static void UseGlobalExceptionHandler(this IApplicationBuilder app)
+ {
+ app.UseMiddleware();
+ }
}
}
diff --git a/src/1-BuildingBlocks/Web.MVC/Exceptions/GrpcExceptionInterceptor.cs b/src/1-BuildingBlocks/Web.MVC/Exceptions/GrpcGlobalExceptionHandler.cs
similarity index 69%
rename from src/1-BuildingBlocks/Web.MVC/Exceptions/GrpcExceptionInterceptor.cs
rename to src/1-BuildingBlocks/Web.MVC/Exceptions/GrpcGlobalExceptionHandler.cs
index 03e748557..0a42e5dca 100644
--- a/src/1-BuildingBlocks/Web.MVC/Exceptions/GrpcExceptionInterceptor.cs
+++ b/src/1-BuildingBlocks/Web.MVC/Exceptions/GrpcGlobalExceptionHandler.cs
@@ -1,13 +1,21 @@
using Grpc.Core;
using Grpc.Core.Interceptors;
+using Microsoft.Extensions.Logging;
namespace TaskoMask.BuildingBlocks.Web.MVC.Exceptions
{
///
/// Global exception handler for gRPC services
///
- public class GrpcExceptionInterceptor : Interceptor
+ public class GrpcGlobalExceptionHandler : Interceptor
{
+ private readonly ILogger _logger;
+
+ public GrpcGlobalExceptionHandler(ILogger logger)
+ {
+ this._logger = logger;
+ }
+
public override async Task UnaryServerHandler(
TRequest request,
ServerCallContext context,
@@ -19,6 +27,8 @@ public override async Task UnaryServerHandler(
}
catch (Exception exception)
{
+ _logger.LogError(exception, exception.Message);
+
throw new RpcException(new Status(StatusCode.Cancelled, exception.Message));
}
}
diff --git a/src/1-BuildingBlocks/Web.MVC/Exceptions/HttpGlobalExceptionHandler.cs b/src/1-BuildingBlocks/Web.MVC/Exceptions/HttpGlobalExceptionHandler.cs
new file mode 100644
index 000000000..8ac3446de
--- /dev/null
+++ b/src/1-BuildingBlocks/Web.MVC/Exceptions/HttpGlobalExceptionHandler.cs
@@ -0,0 +1,38 @@
+using Microsoft.AspNetCore.Http;
+using Microsoft.Extensions.Logging;
+using System.Net;
+using TaskoMask.BuildingBlocks.Contracts.Helpers;
+
+namespace MonoApi.Services.Afrr.Activations.Api.Helpers;
+
+public class HttpGlobalExceptionHandler : IMiddleware
+{
+ private readonly ILogger _logger;
+
+ public HttpGlobalExceptionHandler(ILogger logger)
+ {
+ this._logger = logger;
+ }
+
+ public async Task InvokeAsync(HttpContext context, RequestDelegate next)
+ {
+ try
+ {
+ await next(context);
+ }
+ catch (Exception exception)
+ {
+ _logger.LogError(exception, exception.Message);
+
+ await HandleExceptionAsync(context);
+ }
+ }
+
+ private static async Task HandleExceptionAsync(HttpContext httpContext)
+ {
+ httpContext.Response.ContentType = "application/json";
+ httpContext.Response.StatusCode = (int)HttpStatusCode.InternalServerError;
+ var result = Result.Failure();
+ await httpContext.Response.WriteAsJsonAsync(result);
+ }
+}
diff --git a/src/1-BuildingBlocks/Web.MVC/Exceptions/ConsumerFaultException.cs b/src/1-BuildingBlocks/Web.MVC/Exceptions/MessageConsumerFaultException.cs
similarity index 53%
rename from src/1-BuildingBlocks/Web.MVC/Exceptions/ConsumerFaultException.cs
rename to src/1-BuildingBlocks/Web.MVC/Exceptions/MessageConsumerFaultException.cs
index 5797bf014..1cd25ccb9 100644
--- a/src/1-BuildingBlocks/Web.MVC/Exceptions/ConsumerFaultException.cs
+++ b/src/1-BuildingBlocks/Web.MVC/Exceptions/MessageConsumerFaultException.cs
@@ -4,9 +4,9 @@ namespace TaskoMask.BuildingBlocks.Web.MVC.Exceptions
///
///
///
- public class ConsumerFaultException : Exception
+ public class MessageConsumerFaultException : Exception
{
- public ConsumerFaultException(string message): base(message)
+ public MessageConsumerFaultException(string message): base(message)
{
}
diff --git a/src/2-Services/Boards/Api/Boards.Read.Api/Configuration/HostingExtensions.cs b/src/2-Services/Boards/Api/Boards.Read.Api/Configuration/HostingExtensions.cs
index f36c05e9a..4ecbe7235 100644
--- a/src/2-Services/Boards/Api/Boards.Read.Api/Configuration/HostingExtensions.cs
+++ b/src/2-Services/Boards/Api/Boards.Read.Api/Configuration/HostingExtensions.cs
@@ -2,10 +2,9 @@
using TaskoMask.BuildingBlocks.Web.MVC.Configuration.Serilog;
using TaskoMask.BuildingBlocks.Web.MVC.Configuration;
using TaskoMask.Services.Boards.Read.Api.Infrastructure.DbContext;
-using TaskoMask.BuildingBlocks.Web.MVC.Exceptions;
using TaskoMask.Services.Boards.Read.Api.Infrastructure.DI;
using Microsoft.AspNetCore.Builder;
-using Microsoft.Extensions.DependencyInjection;
+using TaskoMask.BuildingBlocks.Web.Grpc.Configuration;
namespace TaskoMask.Services.Boards.Read.Api.Configuration
{
@@ -24,10 +23,7 @@ public static WebApplication ConfigureServices(this WebApplicationBuilder builde
builder.Services.AddWebApiPreConfigured(builder.Configuration);
- builder.Services.AddGrpc(options =>
- {
- options.Interceptors.Add();
- });
+ builder.Services.AddGrpcPreConfigured();
builder.Services.AddGrpcClients(builder.Configuration);
diff --git a/src/2-Services/Identity/Api/Identity.Api/Consumers/OwnerProfileUpdatedConsumer.cs b/src/2-Services/Identity/Api/Identity.Api/Consumers/OwnerProfileUpdatedConsumer.cs
index d94b86e85..545835b3a 100644
--- a/src/2-Services/Identity/Api/Identity.Api/Consumers/OwnerProfileUpdatedConsumer.cs
+++ b/src/2-Services/Identity/Api/Identity.Api/Consumers/OwnerProfileUpdatedConsumer.cs
@@ -25,7 +25,7 @@ public override async Task ConsumeMessage(ConsumeContext co
var registerUser = new UpdateUserRequest(context.Message.OldEmail, context.Message.NewEmail);
var result = await _inMemoryBus.SendCommand(registerUser);
if (!result.IsSuccess)
- throw new ConsumerFaultException(result.Message); // Cause to publish Fault message
+ throw new MessageConsumerFaultException(result.Message); // Cause to publish Fault message
}
}
}
diff --git a/src/2-Services/Identity/Api/Identity.Api/Consumers/OwnerRegisteredConsumer.cs b/src/2-Services/Identity/Api/Identity.Api/Consumers/OwnerRegisteredConsumer.cs
index 73d56dcdb..966ed9c7b 100644
--- a/src/2-Services/Identity/Api/Identity.Api/Consumers/OwnerRegisteredConsumer.cs
+++ b/src/2-Services/Identity/Api/Identity.Api/Consumers/OwnerRegisteredConsumer.cs
@@ -25,7 +25,7 @@ public override async Task ConsumeMessage(ConsumeContext contex
var registerUser = new RegisterUserRequest(context.Message.Id, context.Message.Email, context.Message.Password);
var result = await _inMemoryBus.SendCommand(registerUser);
if (!result.IsSuccess)
- throw new ConsumerFaultException(result.Message); // Cause to publish Fault message
+ throw new MessageConsumerFaultException(result.Message); // Cause to publish Fault message
}
}
}
diff --git a/src/2-Services/Owners/Api/Owners.Read.Api/Configuration/HostingExtensions.cs b/src/2-Services/Owners/Api/Owners.Read.Api/Configuration/HostingExtensions.cs
index c62581953..ebf71ed94 100644
--- a/src/2-Services/Owners/Api/Owners.Read.Api/Configuration/HostingExtensions.cs
+++ b/src/2-Services/Owners/Api/Owners.Read.Api/Configuration/HostingExtensions.cs
@@ -6,6 +6,7 @@
using Microsoft.Extensions.DependencyInjection;
using TaskoMask.BuildingBlocks.Web.MVC.Exceptions;
using TaskoMask.Services.Owners.Read.Api.Infrastructure.DI;
+using TaskoMask.BuildingBlocks.Web.Grpc.Configuration;
namespace TaskoMask.Services.Owners.Read.Api.Configuration
{
@@ -24,10 +25,7 @@ public static WebApplication ConfigureServices(this WebApplicationBuilder builde
builder.Services.AddWebApiPreConfigured(builder.Configuration);
- builder.Services.AddGrpc(options =>
- {
- options.Interceptors.Add();
- });
+ builder.Services.AddGrpcPreConfigured();
return builder.Build();
}
diff --git a/src/2-Services/Tasks/Api/Tasks.Read.Api/Configuration/HostingExtensions.cs b/src/2-Services/Tasks/Api/Tasks.Read.Api/Configuration/HostingExtensions.cs
index 0438ee0cf..966de0029 100644
--- a/src/2-Services/Tasks/Api/Tasks.Read.Api/Configuration/HostingExtensions.cs
+++ b/src/2-Services/Tasks/Api/Tasks.Read.Api/Configuration/HostingExtensions.cs
@@ -6,6 +6,7 @@
using TaskoMask.Services.Tasks.Read.Api.Infrastructure.DI;
using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.DependencyInjection;
+using TaskoMask.BuildingBlocks.Web.Grpc.Configuration;
namespace TaskoMask.Services.Tasks.Read.Api.Configuration
{
@@ -24,10 +25,7 @@ public static WebApplication ConfigureServices(this WebApplicationBuilder builde
builder.Services.AddWebApiPreConfigured(builder.Configuration);
- builder.Services.AddGrpc(options =>
- {
- options.Interceptors.Add();
- });
+ builder.Services.AddGrpcPreConfigured();
builder.Services.AddGrpcClients(builder.Configuration);
diff --git a/src/6-Docker/Infrastructure.yml b/src/6-Docker/Infrastructure.yml
index f21f37ebe..dbd99eea5 100644
--- a/src/6-Docker/Infrastructure.yml
+++ b/src/6-Docker/Infrastructure.yml
@@ -1,3 +1,4 @@
+---
#----------------------------------------------------------------------------------
# |
# If you want to run or debug some clients or services you need to first make the |
@@ -5,17 +6,16 @@
# |
# Just run the below command through CLI and then the environment is ready: |
# |
-# ...\TaskoMask\src\6-Docker> docker-compose -f Infrastucture.yml up -d |
+# ...\TaskoMask\src\6-Docker> docker-compose -f Infrastructure.yml up -d |
# |
-# For more informition go to releated the documentation on GitHub: |
+# For more informition go to the releated documentation on GitHub: |
# |
# https://github.com/hamed-shirbandi/TaskoMask/wiki/Development-Setup |
#----------------------------------------------------------------------------------
-version: '3.4'
+version: "3.4"
services:
-
seq:
container_name: seq
image: datalust/seq
@@ -25,6 +25,8 @@ services:
- 5341:5341
volumes:
- seq:/data
+ environment:
+ ACCEPT_EULA: "Y"
redis:
container_name: redis
@@ -42,15 +44,16 @@ services:
ports:
- 27017:27017
volumes:
- - mongo:/data/db
+ - mongo:/data/db
sql:
container_name: sql
image: mcr.microsoft.com/mssql/server
restart: unless-stopped
+ user: root
environment:
- SA_PASSWORD: "Your_password123"
- ACCEPT_EULA: "Y"
+ SA_PASSWORD: "Your_pass_!@2#33"
+ ACCEPT_EULA: "Y"
ports:
- "1433:1433"
volumes:
@@ -64,7 +67,7 @@ services:
- "5672:5672"
- "15672:15672"
volumes:
- - rabbitmq:/var/lib/rabbitmq/mnesia/
+ - rabbitmq:/var/lib/rabbitmq/mnesia/
volumes:
redis:
@@ -72,4 +75,3 @@ volumes:
seq:
sql:
rabbitmq:
-