c# - Microsoft.graph API 无法读取电子邮件
问题描述
我正在使用Microsoft.graph API从 office365 帐户读取电子邮件。当我同时阅读多个帐户时,我遇到了一个问题。对于某些帐户,数据会被跳过。
例如,如果 xyx@microsoft.com 帐户的“收件箱”文件夹中包含大约90k封电子邮件,那么在从 API 读取电子邮件时,我们只会收到大约40k封电子邮件。当我们放置多个帐户进行迁移时,会观察到此结果。对于单帐户迁移,它可以正常工作。
ExcMsg : **Too many concurrent connections opened., Cannot open mailbox.**
Stack:
at Microsoft.Exchange.WebServices.Data.ServiceResponse.InternalThrowIfNecessary(),
at Microsoft.Exchange.WebServices.Data.MultiResponseServiceRequest`1.<ExecuteAsync>d__6.MoveNext(),
--- End of stack trace from previous location where exception was thrown ---,
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw(),
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task),
at Microsoft.Exchange.WebServices.Data.ExchangeService.<BindToItem>d__71.MoveNext(),
--- End of stack trace from previous location where exception was thrown ---,
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw(),
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task),
at Microsoft.Exchange.WebServices.Data.ExchangeService.<BindToItem>d__72`1.MoveNext()
if (MessagesList != null && MessagesList.NextPageRequest != null)
MessagesListRequest = MessagesList.NextPageRequest;
MessagesList = MicrosoftHelper.InvokeApiCall(() =>
{
return MessagesListRequest.GetAsync().Result;
}, this.Context);
where MessagesList is IMailFolderMessagesCollectionPage
解决方案
推荐阅读
- c# - Unity 测试广告未展示
- excel - 匹配excel中的多列,然后在单独的列中提供值
- sql-server - 如何获取触发器中使用了更新的信息?
- merge - 如何在 Power BI 中合并两个基于非键表的表
- swift - 在 SwiftUI 视图中创建拖动句柄(用于可拖动窗口等)
- python - Raspberry Pi 上的声音激活录音和高级过滤
- ignite - 点燃重复执行
- sql-server - 如何使用用户定义函数遍历列值
- wordpress - 如何使用 dokan 获得所有精选卖家
- laravel - 登录用户时在 Laravel 8 jetstream 中将默认 Bcrypt 更改为 sha1