public Task Handle(ShippingReqEvent @event) { using (IServiceScope scope = _serviceProvider.CreateScope()) { var logger = scope.ServiceProvider.GetRequiredService <ILogger <ShippingRequestHandler> >(); mqPublisher.PublishAsync(new OrderStausChangeEvent { OrderId = @event.OrderId, Status = "Dispatch" }); } return(Task.CompletedTask); }
public async Task <ActionResult> Get() { await _eventBus.PublishAsync(new ShippingReqEvent { OrderId = Guid.NewGuid() }); return(Content("Order Queued")); }