C# 企业库瞬时故障处理与StackExchange.Redis一起连接到azure Redis缓存

C# 企业库瞬时故障处理与StackExchange.Redis一起连接到azure Redis缓存,c#,redis,stackexchange.redis,azure-redis-cache,C#,Redis,Stackexchange.redis,Azure Redis Cache,我目前正在使用MS Enterprise Library 6瞬态故障处理应用程序块。我提供了一个无效的RedisCacheKey来模拟服务中断 瞬时故障处理 StackExchange.Redis正在冲击azure Redis缓存吗?有人实现过类似的功能吗?@MarcGravel,你能帮我解释一下吗?这可能不是问题所在,但你不应该在ExecuteAction调用中返回GetDatabase()调用的结果吗?例如:cache=retryPolicy.ExecuteAction(()=>return

我目前正在使用MS Enterprise Library 6瞬态故障处理应用程序块。我提供了一个无效的
RedisCacheKey
来模拟服务中断

瞬时故障处理
StackExchange.Redis正在冲击azure Redis缓存吗?有人实现过类似的功能吗?

@MarcGravel,你能帮我解释一下吗?这可能不是问题所在,但你不应该在ExecuteAction调用中返回GetDatabase()调用的结果吗?例如:cache=retryPolicy.ExecuteAction(()=>return Redis.GetDatabase());
var retryStrategy = new FixedInterval(3, TimeSpan.FromSeconds(1));
var retryPolicy = new RetryPolicy<AzureRedisTransientErrorDetectionStrategy>(retryStrategy);
IDatabase cache;
try
{
    cache = retryPolicy.ExecuteAction(() => Redis.GetDatabase()); 
                                          //Redis is a ConnectionMultiplexer
     ...
} catch { ... }
A first chance exception of type 'System.Net.Sockets.SocketException' occurred in System.dll
A first chance exception of type 'System.Net.Sockets.SocketException' occurred in System.dll
A first chance exception of type 'System.Net.Sockets.SocketException' occurred in System.dll
A first chance exception of type 'System.Net.Sockets.SocketException' occurred in System.dll
A first chance exception of type 'System.Net.Sockets.SocketException' occurred in System.dll
A first chance exception of type 'System.Net.Sockets.SocketException' occurred in System.dll
A first chance exception of type 'System.Net.Sockets.SocketException' occurred in System.dll
A first chance exception of type 'System.Net.Sockets.SocketException' occurred in System.dll
A first chance exception of type 'System.Net.Sockets.SocketException' occurred in System.dll
A first chance exception of type 'System.Net.Sockets.SocketException' occurred in System.dll
A first chance exception of type 'System.Net.Sockets.SocketException' occurred in System.dll
A first chance exception of type 'System.Net.Sockets.SocketException' occurred in System.dll
A first chance exception of type 'System.Net.Sockets.SocketException' occurred in System.dll
A first chance exception of type 'System.Net.Sockets.SocketException' occurred in System.dll
A first chance exception of type 'System.Net.Sockets.SocketException' occurred in System.dll
A first chance exception of type 'System.Net.Sockets.SocketException' occurred in System.dll
A first chance exception of type 'System.ObjectDisposedException' occurred in System.dll
A first chance exception of type 'System.Net.Sockets.SocketException' occurred in System.dll
A first chance exception of type 'System.Net.Sockets.SocketException' occurred in System.dll
A first chance exception of type 'System.Net.Sockets.SocketException' occurred in System.dll
A first chance exception of type 'System.Net.Sockets.SocketException' occurred in System.dll
A first chance exception of type 'System.Net.Sockets.SocketException' occurred in System.dll
A first chance exception of type 'System.Net.Sockets.SocketException' occurred in System.dll
A first chance exception of type 'System.ObjectDisposedException' occurred in System.dll
A first chance exception of type 'System.Net.Sockets.SocketException' occurred in System.dll
A first chance exception of type 'System.Net.Sockets.SocketException' occurred in System.dll
A first chance exception of type 'System.Net.Sockets.SocketException' occurred in System.dll
The thread 0x107c has exited with code 259 (0x103).
A first chance exception of type 'StackExchange.Redis.RedisConnectionException' occurred in StackExchange.Redis.dll
The thread 0x115c has exited with code 259 (0x103).
A first chance exception of type 'StackExchange.Redis.RedisConnectionException' occurred in Microsoft.Practices.EnterpriseLibrary.TransientFaultHandling.dll
The thread 0xc04 has exited with code 259 (0x103).
The thread 0x10b8 has exited with code 259 (0x103).
The thread 0x1328 has exited with code 259 (0x103).
The thread 0x1244 has exited with code 259 (0x103).
The thread 0x748 has exited with code 259 (0x103).
The thread 0x14c0 has exited with code 259 (0x103).
The thread 0x1260 has exited with code 259 (0x103).
The thread 0x998 has exited with code 259 (0x103).
The thread 0x10b8 has exited with code 259 (0x103).
The thread 0x145c has exited with code 259 (0x103).
The thread 0x175c has exited with code 259 (0x103).
The thread 0x9a0 has exited with code 259 (0x103).