public Task Handle(CustomerActionNotification notification, CancellationToken cancellationToken) { return(Task.Run(() => { _rabbitMq.PublishMessage("Customer", notification); })); }
public void SendMessage(INameMessage nameMessage) { if (nameMessage == null) { throw new ArgumentNullException(nameof(nameMessage)); } var objNameMessage = new NameMessage { Message = nameMessage.Message }; var serializedMessage = JsonConvert.SerializeObject(objNameMessage); _rabbitMqService.CreateConnection(); _rabbitMqService.PublishMessage(serializedMessage); _rabbitMqService.CloseConnection(); }