async Task IRedisMessageHandler.HandleMessageAsync(IAcknowledgement acknowledgement, string message, string messageId) { T deserialized; try { deserialized = Deserialize(message); } catch (Exception exception) { Logger.LogError(exception, "error deserializing message"); await acknowledgement.NackAsync(); return; } try { await HandleMessageAsync(acknowledgement, deserialized, messageId); } catch (Exception exception) { Logger.LogError(exception, "error handling message", new Dictionary <string, object> { { "message", message } }); await acknowledgement.RequeueAsync(); } }
public override async Task HandleMessageAsync( IAcknowledgement acknowledgement, StringRedisMessage message, string messageId) { Console.WriteLine($"{_consumer} {message.Value} {messageId}"); await acknowledgement.AckAsync(); }
public abstract Task HandleMessageAsync(IAcknowledgement acknowledgement, T message, string messageId);