private async Task PublishAsyncCore <TM>(TM message, CancellationToken cancellationToken) where TM : IMessage { var writer = _channelFactory.GetWriter <TM>(); if (writer is not null) { await writer.WriteAsync(message, cancellationToken) .ConfigureAwait(false); } }
private async Task PublishAsyncCore <TM>(TM message, CancellationToken cancellationToken) where TM : IMessage { var writer = _channelFactory.GetWriter <TM>(); if (writer is not null) { _logger.LogInformation($"publishing message '{message.Id}'..."); await writer.WriteAsync(message, cancellationToken) .ConfigureAwait(false); } else { _logger.LogWarning($"no suitable publisher found for message '{message.Id}' with type '{typeof(TM).FullName}' !"); } }