我正在使用 Microsoft.graph API 从Office365帐户读取电子邮件。 同时读取多个帐户时遇到问题。对于某些帐户,数据会被跳过。
例如如果xyx@microsoft.com帐户的文件夹“收件箱”中包含大约 90k 封电子邮件,那么从API读取电子邮件时,我们只会收到大约 40000 封电子邮件。 当我们放置多个帐户进行迁移时,会观察到此结果。对于单帐户迁移,它可以正常工作。
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