public async Task HandleApplicationMessageReceivedAsync(MqttApplicationMessageReceivedEventArgs eventArgs) { var consumeResult = new ConsumeMessageResult(_topics); consumeResult.SetMessageAsync(eventArgs.ApplicationMessage); consumeResult.PublishToDomainAsync(_serviceProvider, _logger, CancellationToken.None); }
private void HandleApplicationMessageReceivedAsync(RedisChannel channel, RedisValue value) { var consumeResult = new ConsumeMessageResult(_topics); var message = new RedisMessage() { Payload = value, Topic = channel }; consumeResult.SetMessageAsync(message); consumeResult.PublishToDomainAsync(_serviceProvider, _logger, CancellationToken.None); }
public static bool TryConsumeMessage(this IConsumer <Ignore, string> consumer, int timeOut, ConsumeMessageResult result, CancellationToken cancellationToken) { if (!TryConsume(consumer, timeOut, out var consumeResult, cancellationToken)) { return(false); } result.SetMessageAsync(consumeResult); return(true); }