public RedisMessageStateHandler(IConnectionMultiplexer connection, RedisConfiguration configuration, RedisMessage <T> redisMessage, int deadLetterDeliveryLimit, IDependencyInjection messageScope) { _redisMessage = redisMessage; _queueClient = new RedisQueueClient <T>(connection.GetDatabase(configuration.DatabaseId), configuration.MessageSerializer); DeadLetterDeliveryLimit = deadLetterDeliveryLimit; MessageScope = messageScope; }
internal Task CompleteMessageAsync(RedisMessage <T> message) { return(Task.WhenAll( _db.KeyDeleteAsync(new RedisKey[] { message.HashKey, message.ExpirationKey }), _db.ListRemoveAsync(RedisQueueConventions.GetProcessingQueueName(_queueName), message.RedisValue, -1))); }
private async Task ProcessMessageAsync(RedisMessage <T> redisMessage, CancellationToken cancellationToken) { var stateHandler = new RedisMessageStateHandler <T>(ConnectionMultiplexer, _redisConfiguration, redisMessage, _settings.DeadLetterDeliveryLimit, _queueName); await _processor.ProcessAsync(stateHandler, cancellationToken).ConfigureAwait(false); }
public RedisMessageStateHandler(IConnectionMultiplexer connection, RedisConfiguration configuration, RedisMessage <T> redisMessage, int deadLetterDeliveryLimit, string queueName) { _db = connection.GetDatabase(configuration.DatabaseId); _redisMessage = redisMessage; DeadLetterDeliveryLimit = deadLetterDeliveryLimit; _queueName = queueName; }