Add back logging traces referenced in the wiki
This commit is contained in:
parent
5013ff40ba
commit
a1f64f9b6c
src
Services
Basket/Basket.API/IntegrationEvents/EventHandling
Catalog/Catalog.API/IntegrationEvents
CatalogIntegrationEventService.cs
EventHandling
Location/Locations.API/Infrastructure/Services
Marketing/Marketing.API/IntegrationEvents/Handlers
Ordering
Ordering.API
Application
Behaviors
Commands
DomainEventHandlers/BuyerAndPaymentMethodVerified
IntegrationEvents
EventHandling
GracePeriodConfirmedIntegrationEventHandler.csOrderPaymentFailedIntegrationEventHandler.csOrderPaymentSucceededIntegrationEventHandler.csOrderStockConfirmedIntegrationEventHandler.csOrderStockRejectedIntegrationEventHandler.csUserCheckoutAcceptedIntegrationEventHandler.cs
OrderingIntegrationEventService.csControllers
Ordering.BackgroundTasks
Ordering.Domain/AggregatesModel/OrderAggregate
Ordering.SignalrHub/IntegrationEvents/EventHandling
OrderStatusChangedToAwaitingValidationIntegrationEventHandler.csOrderStatusChangedToCancelledIntegrationEventHandler.csOrderStatusChangedToPaidIntegrationEventHandler.csOrderStatusChangedToShippedIntegrationEventHandler.csOrderStatusChangedToStockConfirmedIntegrationEventHandler.csOrderStatusChangedToSubmittedIntegrationEventHandler.cs
Payment/Payment.API/IntegrationEvents/EventHandling
Web/WebMVC/Controllers
@ -26,6 +26,8 @@ namespace Basket.API.IntegrationEvents.EventHandling
|
|||||||
{
|
{
|
||||||
using (LogContext.PushProperty("IntegrationEventContext", $"{@event.Id}-{Program.AppName}"))
|
using (LogContext.PushProperty("IntegrationEventContext", $"{@event.Id}-{Program.AppName}"))
|
||||||
{
|
{
|
||||||
|
_logger.LogInformation("----- Handling integration event: {IntegrationEventId} at {AppName} - ({@IntegrationEvent})", @event.Id, Program.AppName, @event);
|
||||||
|
|
||||||
await _repository.DeleteBasketAsync(@event.UserId.ToString());
|
await _repository.DeleteBasketAsync(@event.UserId.ToString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -26,6 +26,8 @@ namespace Microsoft.eShopOnContainers.Services.Basket.API.IntegrationEvents.Even
|
|||||||
{
|
{
|
||||||
using (LogContext.PushProperty("IntegrationEventContext", $"{@event.Id}-{Program.AppName}"))
|
using (LogContext.PushProperty("IntegrationEventContext", $"{@event.Id}-{Program.AppName}"))
|
||||||
{
|
{
|
||||||
|
_logger.LogInformation("----- Handling integration event: {IntegrationEventId} at {AppName} - ({@IntegrationEvent})", @event.Id, Program.AppName, @event);
|
||||||
|
|
||||||
var userIds = _repository.GetUsers();
|
var userIds = _repository.GetUsers();
|
||||||
|
|
||||||
foreach (var id in userIds)
|
foreach (var id in userIds)
|
||||||
@ -43,6 +45,8 @@ namespace Microsoft.eShopOnContainers.Services.Basket.API.IntegrationEvents.Even
|
|||||||
|
|
||||||
if (itemsToUpdate != null)
|
if (itemsToUpdate != null)
|
||||||
{
|
{
|
||||||
|
_logger.LogInformation("----- ProductPriceChangedIntegrationEventHandler - Updating items in basket for user: {BuyerId} ({@Items})", basket.BuyerId, itemsToUpdate);
|
||||||
|
|
||||||
foreach (var item in itemsToUpdate)
|
foreach (var item in itemsToUpdate)
|
||||||
{
|
{
|
||||||
if (item.UnitPrice == oldPrice)
|
if (item.UnitPrice == oldPrice)
|
||||||
|
@ -39,6 +39,8 @@ namespace Catalog.API.IntegrationEvents
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
_logger.LogInformation("----- Publishing integration event: {IntegrationEventId_published} from {AppName} - ({@IntegrationEvent})", evt.Id, Program.AppName, evt);
|
||||||
|
|
||||||
await _eventLogService.MarkEventAsInProgressAsync(evt.Id);
|
await _eventLogService.MarkEventAsInProgressAsync(evt.Id);
|
||||||
_eventBus.Publish(evt);
|
_eventBus.Publish(evt);
|
||||||
await _eventLogService.MarkEventAsPublishedAsync(evt.Id);
|
await _eventLogService.MarkEventAsPublishedAsync(evt.Id);
|
||||||
@ -52,6 +54,8 @@ namespace Catalog.API.IntegrationEvents
|
|||||||
|
|
||||||
public async Task SaveEventAndCatalogContextChangesAsync(IntegrationEvent evt)
|
public async Task SaveEventAndCatalogContextChangesAsync(IntegrationEvent evt)
|
||||||
{
|
{
|
||||||
|
_logger.LogInformation("----- CatalogIntegrationEventService - Saving changes and integrationEvent: {IntegrationEventId}", evt.Id);
|
||||||
|
|
||||||
//Use of an EF Core resiliency strategy when using multiple DbContexts within an explicit BeginTransaction():
|
//Use of an EF Core resiliency strategy when using multiple DbContexts within an explicit BeginTransaction():
|
||||||
//See: https://docs.microsoft.com/en-us/ef/core/miscellaneous/connection-resiliency
|
//See: https://docs.microsoft.com/en-us/ef/core/miscellaneous/connection-resiliency
|
||||||
await ResilientTransaction.New(_catalogContext).ExecuteAsync(async () =>
|
await ResilientTransaction.New(_catalogContext).ExecuteAsync(async () =>
|
||||||
|
@ -32,6 +32,8 @@
|
|||||||
{
|
{
|
||||||
using (LogContext.PushProperty("IntegrationEventContext", $"{@event.Id}-{Program.AppName}"))
|
using (LogContext.PushProperty("IntegrationEventContext", $"{@event.Id}-{Program.AppName}"))
|
||||||
{
|
{
|
||||||
|
_logger.LogInformation("----- Handling integration event: {IntegrationEventId} at {AppName} - ({@IntegrationEvent})", @event.Id, Program.AppName, @event);
|
||||||
|
|
||||||
var confirmedOrderStockItems = new List<ConfirmedOrderStockItem>();
|
var confirmedOrderStockItems = new List<ConfirmedOrderStockItem>();
|
||||||
|
|
||||||
foreach (var orderStockItem in @event.OrderStockItems)
|
foreach (var orderStockItem in @event.OrderStockItems)
|
||||||
|
@ -25,6 +25,8 @@
|
|||||||
{
|
{
|
||||||
using (LogContext.PushProperty("IntegrationEventContext", $"{@event.Id}-{Program.AppName}"))
|
using (LogContext.PushProperty("IntegrationEventContext", $"{@event.Id}-{Program.AppName}"))
|
||||||
{
|
{
|
||||||
|
_logger.LogInformation("----- Handling integration event: {IntegrationEventId} at {AppName} - ({@IntegrationEvent})", @event.Id, Program.AppName, @event);
|
||||||
|
|
||||||
//we're not blocking stock/inventory
|
//we're not blocking stock/inventory
|
||||||
foreach (var orderStockItem in @event.OrderStockItems)
|
foreach (var orderStockItem in @event.OrderStockItems)
|
||||||
{
|
{
|
||||||
|
@ -72,6 +72,9 @@
|
|||||||
{
|
{
|
||||||
var newUserLocations = MapUserLocationDetails(newLocations);
|
var newUserLocations = MapUserLocationDetails(newLocations);
|
||||||
var @event = new UserLocationUpdatedIntegrationEvent(userId, newUserLocations);
|
var @event = new UserLocationUpdatedIntegrationEvent(userId, newUserLocations);
|
||||||
|
|
||||||
|
_logger.LogInformation("----- Publishing integration event: {IntegrationEventId} from {AppName} - ({@IntegrationEvent})", @event.Id, Program.AppName, @event);
|
||||||
|
|
||||||
_eventBus.Publish(@event);
|
_eventBus.Publish(@event);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -28,6 +28,8 @@
|
|||||||
{
|
{
|
||||||
using (LogContext.PushProperty("IntegrationEventContext", $"{@event.Id}-{Program.AppName}"))
|
using (LogContext.PushProperty("IntegrationEventContext", $"{@event.Id}-{Program.AppName}"))
|
||||||
{
|
{
|
||||||
|
_logger.LogInformation("----- Handling integration event: {IntegrationEventId} at {AppName} - ({@IntegrationEvent})", @event.Id, Program.AppName, @event);
|
||||||
|
|
||||||
var userMarketingData = await _marketingDataRepository.GetAsync(@event.UserId);
|
var userMarketingData = await _marketingDataRepository.GetAsync(@event.UserId);
|
||||||
userMarketingData = userMarketingData ??
|
userMarketingData = userMarketingData ??
|
||||||
new MarketingData() { UserId = @event.UserId };
|
new MarketingData() { UserId = @event.UserId };
|
||||||
|
@ -24,6 +24,8 @@ namespace Ordering.API.Application.Behaviors
|
|||||||
{
|
{
|
||||||
var typeName = request.GetGenericTypeName();
|
var typeName = request.GetGenericTypeName();
|
||||||
|
|
||||||
|
_logger.LogInformation("----- Validating command {CommandType}", typeName);
|
||||||
|
|
||||||
var failures = _validators
|
var failures = _validators
|
||||||
.Select(v => v.Validate(request))
|
.Select(v => v.Validate(request))
|
||||||
.SelectMany(result => result.Errors)
|
.SelectMany(result => result.Errors)
|
||||||
|
@ -53,6 +53,8 @@
|
|||||||
order.AddOrderItem(item.ProductId, item.ProductName, item.UnitPrice, item.Discount, item.PictureUrl, item.Units);
|
order.AddOrderItem(item.ProductId, item.ProductName, item.UnitPrice, item.Discount, item.PictureUrl, item.Units);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_logger.LogInformation("----- Creating Order - Order: {@Order}", order);
|
||||||
|
|
||||||
_orderRepository.Add(order);
|
_orderRepository.Add(order);
|
||||||
|
|
||||||
return await _orderRepository.UnitOfWork
|
return await _orderRepository.UnitOfWork
|
||||||
|
@ -26,12 +26,12 @@ namespace Ordering.API.Application.DomainEventHandlers.BuyerAndPaymentMethodVeri
|
|||||||
// then we can update the original Order with the BuyerId and PaymentId (foreign keys)
|
// then we can update the original Order with the BuyerId and PaymentId (foreign keys)
|
||||||
public async Task Handle(BuyerAndPaymentMethodVerifiedDomainEvent buyerPaymentMethodVerifiedEvent, CancellationToken cancellationToken)
|
public async Task Handle(BuyerAndPaymentMethodVerifiedDomainEvent buyerPaymentMethodVerifiedEvent, CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
var log = _logger.CreateLogger<UpdateOrderWhenBuyerAndPaymentMethodVerifiedDomainEventHandler>();
|
|
||||||
var orderToUpdate = await _orderRepository.GetAsync(buyerPaymentMethodVerifiedEvent.OrderId);
|
var orderToUpdate = await _orderRepository.GetAsync(buyerPaymentMethodVerifiedEvent.OrderId);
|
||||||
orderToUpdate.SetBuyerId(buyerPaymentMethodVerifiedEvent.Buyer.Id);
|
orderToUpdate.SetBuyerId(buyerPaymentMethodVerifiedEvent.Buyer.Id);
|
||||||
orderToUpdate.SetPaymentId(buyerPaymentMethodVerifiedEvent.Payment.Id);
|
orderToUpdate.SetPaymentId(buyerPaymentMethodVerifiedEvent.Payment.Id);
|
||||||
|
|
||||||
log.LogTrace("Order with Id: {OrderId} has been successfully updated with a payment method {PaymentMethod} ({Id})",
|
_logger.CreateLogger<UpdateOrderWhenBuyerAndPaymentMethodVerifiedDomainEventHandler>()
|
||||||
|
.LogTrace("Order with Id: {OrderId} has been successfully updated with a payment method {PaymentMethod} ({Id})",
|
||||||
buyerPaymentMethodVerifiedEvent.OrderId, nameof(buyerPaymentMethodVerifiedEvent.Payment), buyerPaymentMethodVerifiedEvent.Payment.Id);
|
buyerPaymentMethodVerifiedEvent.OrderId, nameof(buyerPaymentMethodVerifiedEvent.Payment), buyerPaymentMethodVerifiedEvent.Payment.Id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -37,6 +37,8 @@ namespace Ordering.API.Application.IntegrationEvents.EventHandling
|
|||||||
{
|
{
|
||||||
using (LogContext.PushProperty("IntegrationEventContext", $"{@event.Id}-{Program.AppName}"))
|
using (LogContext.PushProperty("IntegrationEventContext", $"{@event.Id}-{Program.AppName}"))
|
||||||
{
|
{
|
||||||
|
_logger.LogInformation("----- Handling integration event: {IntegrationEventId} at {AppName} - ({@IntegrationEvent})", @event.Id, Program.AppName, @event);
|
||||||
|
|
||||||
var command = new SetAwaitingValidationOrderStatusCommand(@event.OrderId);
|
var command = new SetAwaitingValidationOrderStatusCommand(@event.OrderId);
|
||||||
|
|
||||||
_logger.LogInformation(
|
_logger.LogInformation(
|
||||||
|
@ -31,6 +31,8 @@
|
|||||||
{
|
{
|
||||||
using (LogContext.PushProperty("IntegrationEventContext", $"{@event.Id}-{Program.AppName}"))
|
using (LogContext.PushProperty("IntegrationEventContext", $"{@event.Id}-{Program.AppName}"))
|
||||||
{
|
{
|
||||||
|
_logger.LogInformation("----- Handling integration event: {IntegrationEventId} at {AppName} - ({@IntegrationEvent})", @event.Id, Program.AppName, @event);
|
||||||
|
|
||||||
var command = new CancelOrderCommand(@event.OrderId);
|
var command = new CancelOrderCommand(@event.OrderId);
|
||||||
|
|
||||||
_logger.LogInformation(
|
_logger.LogInformation(
|
||||||
|
@ -31,6 +31,8 @@
|
|||||||
{
|
{
|
||||||
using (LogContext.PushProperty("IntegrationEventContext", $"{@event.Id}-{Program.AppName}"))
|
using (LogContext.PushProperty("IntegrationEventContext", $"{@event.Id}-{Program.AppName}"))
|
||||||
{
|
{
|
||||||
|
_logger.LogInformation("----- Handling integration event: {IntegrationEventId} at {AppName} - ({@IntegrationEvent})", @event.Id, Program.AppName, @event);
|
||||||
|
|
||||||
var command = new SetPaidOrderStatusCommand(@event.OrderId);
|
var command = new SetPaidOrderStatusCommand(@event.OrderId);
|
||||||
|
|
||||||
_logger.LogInformation(
|
_logger.LogInformation(
|
||||||
|
@ -31,6 +31,8 @@
|
|||||||
{
|
{
|
||||||
using (LogContext.PushProperty("IntegrationEventContext", $"{@event.Id}-{Program.AppName}"))
|
using (LogContext.PushProperty("IntegrationEventContext", $"{@event.Id}-{Program.AppName}"))
|
||||||
{
|
{
|
||||||
|
_logger.LogInformation("----- Handling integration event: {IntegrationEventId} at {AppName} - ({@IntegrationEvent})", @event.Id, Program.AppName, @event);
|
||||||
|
|
||||||
var command = new SetStockConfirmedOrderStatusCommand(@event.OrderId);
|
var command = new SetStockConfirmedOrderStatusCommand(@event.OrderId);
|
||||||
|
|
||||||
_logger.LogInformation(
|
_logger.LogInformation(
|
||||||
|
@ -30,6 +30,8 @@
|
|||||||
{
|
{
|
||||||
using (LogContext.PushProperty("IntegrationEventContext", $"{@event.Id}-{Program.AppName}"))
|
using (LogContext.PushProperty("IntegrationEventContext", $"{@event.Id}-{Program.AppName}"))
|
||||||
{
|
{
|
||||||
|
_logger.LogInformation("----- Handling integration event: {IntegrationEventId} at {AppName} - ({@IntegrationEvent})", @event.Id, Program.AppName, @event);
|
||||||
|
|
||||||
var orderStockRejectedItems = @event.OrderStockItems
|
var orderStockRejectedItems = @event.OrderStockItems
|
||||||
.FindAll(c => !c.HasStock)
|
.FindAll(c => !c.HasStock)
|
||||||
.Select(c => c.ProductId)
|
.Select(c => c.ProductId)
|
||||||
|
@ -35,9 +35,11 @@ namespace Ordering.API.Application.IntegrationEvents.EventHandling
|
|||||||
/// </param>
|
/// </param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public async Task Handle(UserCheckoutAcceptedIntegrationEvent @event)
|
public async Task Handle(UserCheckoutAcceptedIntegrationEvent @event)
|
||||||
{
|
{
|
||||||
using (LogContext.PushProperty("IntegrationEventContext", $"{@event.Id}-{Program.AppName}"))
|
using (LogContext.PushProperty("IntegrationEventContext", $"{@event.Id}-{Program.AppName}"))
|
||||||
{
|
{
|
||||||
|
_logger.LogInformation("----- Handling integration event: {IntegrationEventId} at {AppName} - ({@IntegrationEvent})", @event.Id, Program.AppName, @event);
|
||||||
|
|
||||||
var result = false;
|
var result = false;
|
||||||
|
|
||||||
if (@event.RequestId != Guid.Empty)
|
if (@event.RequestId != Guid.Empty)
|
||||||
@ -60,7 +62,11 @@ namespace Ordering.API.Application.IntegrationEvents.EventHandling
|
|||||||
|
|
||||||
result = await _mediator.Send(requestCreateOrder);
|
result = await _mediator.Send(requestCreateOrder);
|
||||||
|
|
||||||
if (!result)
|
if (result)
|
||||||
|
{
|
||||||
|
_logger.LogInformation("----- CreateOrderCommand suceeded - RequestId: {RequestId}", @event.RequestId);
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
_logger.LogWarning("CreateOrderCommand failed - RequestId: {RequestId}", @event.RequestId);
|
_logger.LogWarning("CreateOrderCommand failed - RequestId: {RequestId}", @event.RequestId);
|
||||||
}
|
}
|
||||||
|
4
src/Services/Ordering/Ordering.API/Application/IntegrationEvents/OrderingIntegrationEventService.cs
4
src/Services/Ordering/Ordering.API/Application/IntegrationEvents/OrderingIntegrationEventService.cs
@ -45,6 +45,8 @@ namespace Ordering.API.Application.IntegrationEvents
|
|||||||
|
|
||||||
foreach (var logEvt in pendingLogEvents)
|
foreach (var logEvt in pendingLogEvents)
|
||||||
{
|
{
|
||||||
|
_logger.LogInformation("----- Publishing integration event: {IntegrationEventId} from {AppName} - ({@IntegrationEvent})", logEvt.EventId, Program.AppName, logEvt.IntegrationEvent);
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
await _eventLogService.MarkEventAsInProgressAsync(logEvt.EventId);
|
await _eventLogService.MarkEventAsInProgressAsync(logEvt.EventId);
|
||||||
@ -62,6 +64,8 @@ namespace Ordering.API.Application.IntegrationEvents
|
|||||||
|
|
||||||
public async Task AddAndSaveEventAsync(IntegrationEvent evt)
|
public async Task AddAndSaveEventAsync(IntegrationEvent evt)
|
||||||
{
|
{
|
||||||
|
_logger.LogInformation("----- Enqueuing integration event {IntegrationEventId} to repository ({@IntegrationEvent})", evt.Id, evt);
|
||||||
|
|
||||||
await _eventLogService.SaveEventAsync(evt, _orderingContext.GetCurrentTransaction());
|
await _eventLogService.SaveEventAsync(evt, _orderingContext.GetCurrentTransaction());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -49,7 +49,7 @@ namespace Microsoft.eShopOnContainers.Services.Ordering.API.Controllers
|
|||||||
{
|
{
|
||||||
var requestCancelOrder = new IdentifiedCommand<CancelOrderCommand, bool>(command, guid);
|
var requestCancelOrder = new IdentifiedCommand<CancelOrderCommand, bool>(command, guid);
|
||||||
|
|
||||||
_logger.LogTrace(
|
_logger.LogInformation(
|
||||||
"----- Sending command: {CommandName} - {IdProperty}: {CommandId} ({@Command})",
|
"----- Sending command: {CommandName} - {IdProperty}: {CommandId} ({@Command})",
|
||||||
requestCancelOrder.GetGenericTypeName(),
|
requestCancelOrder.GetGenericTypeName(),
|
||||||
nameof(requestCancelOrder.Command.OrderNumber),
|
nameof(requestCancelOrder.Command.OrderNumber),
|
||||||
@ -79,7 +79,7 @@ namespace Microsoft.eShopOnContainers.Services.Ordering.API.Controllers
|
|||||||
{
|
{
|
||||||
var requestShipOrder = new IdentifiedCommand<ShipOrderCommand, bool>(command, guid);
|
var requestShipOrder = new IdentifiedCommand<ShipOrderCommand, bool>(command, guid);
|
||||||
|
|
||||||
_logger.LogTrace(
|
_logger.LogInformation(
|
||||||
"----- Sending command: {CommandName} - {IdProperty}: {CommandId} ({@Command})",
|
"----- Sending command: {CommandName} - {IdProperty}: {CommandId} ({@Command})",
|
||||||
requestShipOrder.GetGenericTypeName(),
|
requestShipOrder.GetGenericTypeName(),
|
||||||
nameof(requestShipOrder.Command.OrderNumber),
|
nameof(requestShipOrder.Command.OrderNumber),
|
||||||
@ -141,7 +141,7 @@ namespace Microsoft.eShopOnContainers.Services.Ordering.API.Controllers
|
|||||||
[HttpPost]
|
[HttpPost]
|
||||||
public async Task<ActionResult<OrderDraftDTO>> CreateOrderDraftFromBasketDataAsync([FromBody] CreateOrderDraftCommand createOrderDraftCommand)
|
public async Task<ActionResult<OrderDraftDTO>> CreateOrderDraftFromBasketDataAsync([FromBody] CreateOrderDraftCommand createOrderDraftCommand)
|
||||||
{
|
{
|
||||||
_logger.LogTrace(
|
_logger.LogInformation(
|
||||||
"----- Sending command: {CommandName} - {IdProperty}: {CommandId} ({@Command})",
|
"----- Sending command: {CommandName} - {IdProperty}: {CommandId} ({@Command})",
|
||||||
createOrderDraftCommand.GetGenericTypeName(),
|
createOrderDraftCommand.GetGenericTypeName(),
|
||||||
nameof(createOrderDraftCommand.BuyerId),
|
nameof(createOrderDraftCommand.BuyerId),
|
||||||
|
@ -13,6 +13,9 @@ namespace Ordering.BackgroundTasks
|
|||||||
{
|
{
|
||||||
public class Program
|
public class Program
|
||||||
{
|
{
|
||||||
|
public static readonly string Namespace = typeof(Program).Namespace;
|
||||||
|
public static readonly string AppName = Namespace;
|
||||||
|
|
||||||
public static void Main(string[] args)
|
public static void Main(string[] args)
|
||||||
{
|
{
|
||||||
CreateHostBuilder(args).Run();
|
CreateHostBuilder(args).Run();
|
||||||
|
@ -55,6 +55,8 @@ namespace Ordering.BackgroundTasks.Tasks
|
|||||||
{
|
{
|
||||||
var confirmGracePeriodEvent = new GracePeriodConfirmedIntegrationEvent(orderId);
|
var confirmGracePeriodEvent = new GracePeriodConfirmedIntegrationEvent(orderId);
|
||||||
|
|
||||||
|
_logger.LogInformation("----- Publishing integration event: {IntegrationEventId} from {AppName} - ({@IntegrationEvent})", confirmGracePeriodEvent.Id, Program.AppName, confirmGracePeriodEvent);
|
||||||
|
|
||||||
_eventBus.Publish(confirmGracePeriodEvent);
|
_eventBus.Publish(confirmGracePeriodEvent);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -18,7 +18,7 @@ namespace Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.O
|
|||||||
// Address is a Value Object pattern example persisted as EF Core 2.0 owned entity
|
// Address is a Value Object pattern example persisted as EF Core 2.0 owned entity
|
||||||
public Address Address { get; private set; }
|
public Address Address { get; private set; }
|
||||||
|
|
||||||
public int? GetBuyerId { get { return this._buyerId; } }
|
public int? GetBuyerId => _buyerId;
|
||||||
private int? _buyerId;
|
private int? _buyerId;
|
||||||
|
|
||||||
public OrderStatus OrderStatus { get; private set; }
|
public OrderStatus OrderStatus { get; private set; }
|
||||||
|
@ -27,6 +27,8 @@ namespace Ordering.SignalrHub.IntegrationEvents
|
|||||||
{
|
{
|
||||||
using (LogContext.PushProperty("IntegrationEventContext", $"{@event.Id}-{Program.AppName}"))
|
using (LogContext.PushProperty("IntegrationEventContext", $"{@event.Id}-{Program.AppName}"))
|
||||||
{
|
{
|
||||||
|
_logger.LogInformation("----- Handling integration event: {IntegrationEventId} at {AppName} - ({@IntegrationEvent})", @event.Id, Program.AppName, @event);
|
||||||
|
|
||||||
await _hubContext.Clients
|
await _hubContext.Clients
|
||||||
.Group(@event.BuyerName)
|
.Group(@event.BuyerName)
|
||||||
.SendAsync("UpdatedOrderState", new { OrderId = @event.OrderId, Status = @event.OrderStatus });
|
.SendAsync("UpdatedOrderState", new { OrderId = @event.OrderId, Status = @event.OrderStatus });
|
||||||
|
@ -28,6 +28,8 @@ namespace Ordering.SignalrHub.IntegrationEvents.EventHandling
|
|||||||
{
|
{
|
||||||
using (LogContext.PushProperty("IntegrationEventContext", $"{@event.Id}-{Program.AppName}"))
|
using (LogContext.PushProperty("IntegrationEventContext", $"{@event.Id}-{Program.AppName}"))
|
||||||
{
|
{
|
||||||
|
_logger.LogInformation("----- Handling integration event: {IntegrationEventId} at {AppName} - ({@IntegrationEvent})", @event.Id, Program.AppName, @event);
|
||||||
|
|
||||||
await _hubContext.Clients
|
await _hubContext.Clients
|
||||||
.Group(@event.BuyerName)
|
.Group(@event.BuyerName)
|
||||||
.SendAsync("UpdatedOrderState", new { OrderId = @event.OrderId, Status = @event.OrderStatus });
|
.SendAsync("UpdatedOrderState", new { OrderId = @event.OrderId, Status = @event.OrderStatus });
|
||||||
|
@ -26,6 +26,8 @@ namespace Ordering.SignalrHub.IntegrationEvents.EventHandling
|
|||||||
{
|
{
|
||||||
using (LogContext.PushProperty("IntegrationEventContext", $"{@event.Id}-{Program.AppName}"))
|
using (LogContext.PushProperty("IntegrationEventContext", $"{@event.Id}-{Program.AppName}"))
|
||||||
{
|
{
|
||||||
|
_logger.LogInformation("----- Handling integration event: {IntegrationEventId} at {AppName} - ({@IntegrationEvent})", @event.Id, Program.AppName, @event);
|
||||||
|
|
||||||
await _hubContext.Clients
|
await _hubContext.Clients
|
||||||
.Group(@event.BuyerName)
|
.Group(@event.BuyerName)
|
||||||
.SendAsync("UpdatedOrderState", new { OrderId = @event.OrderId, Status = @event.OrderStatus });
|
.SendAsync("UpdatedOrderState", new { OrderId = @event.OrderId, Status = @event.OrderStatus });
|
||||||
|
@ -28,6 +28,8 @@ namespace Ordering.SignalrHub.IntegrationEvents.EventHandling
|
|||||||
{
|
{
|
||||||
using (LogContext.PushProperty("IntegrationEventContext", $"{@event.Id}-{Program.AppName}"))
|
using (LogContext.PushProperty("IntegrationEventContext", $"{@event.Id}-{Program.AppName}"))
|
||||||
{
|
{
|
||||||
|
_logger.LogInformation("----- Handling integration event: {IntegrationEventId} at {AppName} - ({@IntegrationEvent})", @event.Id, Program.AppName, @event);
|
||||||
|
|
||||||
await _hubContext.Clients
|
await _hubContext.Clients
|
||||||
.Group(@event.BuyerName)
|
.Group(@event.BuyerName)
|
||||||
.SendAsync("UpdatedOrderState", new { OrderId = @event.OrderId, Status = @event.OrderStatus });
|
.SendAsync("UpdatedOrderState", new { OrderId = @event.OrderId, Status = @event.OrderStatus });
|
||||||
|
@ -29,6 +29,8 @@ namespace Ordering.SignalrHub.IntegrationEvents.EventHandling
|
|||||||
{
|
{
|
||||||
using (LogContext.PushProperty("IntegrationEventContext", $"{@event.Id}-{Program.AppName}"))
|
using (LogContext.PushProperty("IntegrationEventContext", $"{@event.Id}-{Program.AppName}"))
|
||||||
{
|
{
|
||||||
|
_logger.LogInformation("----- Handling integration event: {IntegrationEventId} at {AppName} - ({@IntegrationEvent})", @event.Id, Program.AppName, @event);
|
||||||
|
|
||||||
await _hubContext.Clients
|
await _hubContext.Clients
|
||||||
.Group(@event.BuyerName)
|
.Group(@event.BuyerName)
|
||||||
.SendAsync("UpdatedOrderState", new { OrderId = @event.OrderId, Status = @event.OrderStatus });
|
.SendAsync("UpdatedOrderState", new { OrderId = @event.OrderId, Status = @event.OrderStatus });
|
||||||
|
@ -29,6 +29,8 @@ namespace Ordering.SignalrHub.IntegrationEvents.EventHandling
|
|||||||
{
|
{
|
||||||
using (LogContext.PushProperty("IntegrationEventContext", $"{@event.Id}-{Program.AppName}"))
|
using (LogContext.PushProperty("IntegrationEventContext", $"{@event.Id}-{Program.AppName}"))
|
||||||
{
|
{
|
||||||
|
_logger.LogInformation("----- Handling integration event: {IntegrationEventId} at {AppName} - ({@IntegrationEvent})", @event.Id, Program.AppName, @event);
|
||||||
|
|
||||||
await _hubContext.Clients
|
await _hubContext.Clients
|
||||||
.Group(@event.BuyerName)
|
.Group(@event.BuyerName)
|
||||||
.SendAsync("UpdatedOrderState", new { OrderId = @event.OrderId, Status = @event.OrderStatus });
|
.SendAsync("UpdatedOrderState", new { OrderId = @event.OrderId, Status = @event.OrderStatus });
|
||||||
|
@ -31,6 +31,8 @@
|
|||||||
{
|
{
|
||||||
using (LogContext.PushProperty("IntegrationEventContext", $"{@event.Id}-{Program.AppName}"))
|
using (LogContext.PushProperty("IntegrationEventContext", $"{@event.Id}-{Program.AppName}"))
|
||||||
{
|
{
|
||||||
|
_logger.LogInformation("----- Handling integration event: {IntegrationEventId} at {AppName} - ({@IntegrationEvent})", @event.Id, Program.AppName, @event);
|
||||||
|
|
||||||
IntegrationEvent orderPaymentIntegrationEvent;
|
IntegrationEvent orderPaymentIntegrationEvent;
|
||||||
|
|
||||||
//Business feature comment:
|
//Business feature comment:
|
||||||
@ -48,6 +50,8 @@
|
|||||||
orderPaymentIntegrationEvent = new OrderPaymentFailedIntegrationEvent(@event.OrderId);
|
orderPaymentIntegrationEvent = new OrderPaymentFailedIntegrationEvent(@event.OrderId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_logger.LogInformation("----- Publishing integration event: {IntegrationEventId} from {AppName} - ({@IntegrationEvent})", orderPaymentIntegrationEvent.Id, Program.AppName, orderPaymentIntegrationEvent);
|
||||||
|
|
||||||
_eventBus.Publish(orderPaymentIntegrationEvent);
|
_eventBus.Publish(orderPaymentIntegrationEvent);
|
||||||
|
|
||||||
await Task.CompletedTask;
|
await Task.CompletedTask;
|
||||||
|
@ -25,6 +25,8 @@ namespace Microsoft.eShopOnContainers.WebMVC.Controllers
|
|||||||
var user = User as ClaimsPrincipal;
|
var user = User as ClaimsPrincipal;
|
||||||
var token = await HttpContext.GetTokenAsync("access_token");
|
var token = await HttpContext.GetTokenAsync("access_token");
|
||||||
|
|
||||||
|
_logger.LogInformation("----- User {@User} authenticated into {AppName}", user, Program.AppName);
|
||||||
|
|
||||||
if (token != null)
|
if (token != null)
|
||||||
{
|
{
|
||||||
ViewData["access_token"] = token;
|
ViewData["access_token"] = token;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user