简体   繁体   中英

Service Stack Redis reconnect after Redis server reboot

We are using Service Stack's RedisClient's BlockingDequeue to persist some data until it can be processed. The calling code looks like

 using (var client = ClientPool.GetClient())
            return client.As<TMessage>().Lists[_channel].BlockingDequeue(timeout);

If the server hosting Redis is restarted, the connections for the BlockingDequeue go zombie and never return until the client application is restarted.

We have tried setting the timeout on the BlockingDequeue as well as the PooledConnectionManager but neither helped, I am guessing because the timeout is enforced on the server side.

Is this type of fault tolerance built into service stack and we are missing it?

Or is it something that our implementation should handle? If so are there any recommended approaches?

我们在ServiceStack.Redis订阅代码中遇到了同样的问题,我们尝试了一些设置,例如retrycount,retrytimeout等,它们都不起作用,稍后我们的解决方法是捕获RedisException并再次进行订阅。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM