在Azure表上读取重试 [英] Read retry on Azure Table

查看:77
本文介绍了在Azure表上读取重试的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

从Azure Table Storage读取时,有时会出现错误No connection could be made because the target machine actively refused it,有时会出现在80(http)上,有时会出现在443(https)上

I got error No connection could be made because the target machine actively refused it often, when read from Azure Table Storage, sometime on 80(http) sometime on 443(https)

我知道我可以通过.SaveChangesWithRetries()设置重试写入,但是如何在读取时应用重试?

I know I can setup retry for write by .SaveChangesWithRetries(), but how to apply retry on read?

顺便说一句,我通过代码阅读

btw, I read by code

DataServiceQuery<datatype> query = tableContext.CreateQuery<datatype>("table");
IQueryable<datatype> results= from q in query select q

推荐答案

最后,我不得不使用半官方的

Last I had to use the semi-official Transient Fault Handling Framework, but this was over a year ago; and the best practices guidelines may have changed.

编辑

如评论中所指出,此解决方案已演变为瞬态故障处理应用程序块,现在可以作为NuGet软件包使用.

As pointed out in the comments, this solution has evolved into a The Transient Fault Handling Application Block, which is now available as a NuGet package.

对于未启动的人,框架基本上为在任何分布式环境(尤其是Azure)中自然发生的一类传输类型错误指定重试(锤)策略.例如,SQL azure可能返回错误代码服务器太忙,请稍后重试"或您的数据在此途中丢失了,哎呀",而您基本上不需要知道所有这些代码即可说重试".

For the uninitiated, the framework basically specifies retry (hammer) policy for a class of transport-type errors that occur naturally in any distributed environment and particularly in Azure. For example SQL azure may return an error code "Server too busy, try again in a moment" or "Your data got lost on the way over here, oops", and you don't need to know all those codes in order to basically say "Retry".

这篇关于在Azure表上读取重试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆