FoundatioFx/Foundatio.Redis

Redis Queue Retries & Attempts working not as expected

Closed this issue · 2 comments

I noticed some problems with the redis queue implementation.
I tried Redis Queue and Azure Service Bus Queue implementations so i cloud compare.

First Problem:
new RedisQueue<T>(o => o .ConnectionMultiplexer(ConnectionMultiplexer.Connect("redisConnection")) .Retries(1))
Won't do any retry at all. If you increase Retries to 2 it will do one retry so it seems the retry count is -1.
In Compare
return new AzureServiceBusQueue<T>(o => o .ConnectionString("asbConnection") .Retries(1))
Will retry once as expected.

Second Problem:
If i run the redis queue implementation with Retries(3) the Attempts property is wrong too:

Frist Run: Attempts -> 1
Frist Retry: Attempts -> 1
Second Retry: Attempts -> 2

In Compare to AzureServiceBus again:

Frist Run: Attempts -> 1
Frist Retry: Attempts -> 2
Second Retry: Attempts -> 3

I would like to to see an identical behavior.
Thanks

Is there any chance you could add a test and pr for this? This sounds like a bug.

I will try.