服务结构演员超时

时间:2017-10-30 17:20:42

标签: c# azure azure-service-fabric

我有一个基于服务结构OWIN的API,它正在调用服务结构actor。 API在返回响应之前等待actor完成工作。有时演员可能需要很长时间才能完成。

Actor的默认超时为5分钟,我尝试使用以下方法增加操作超时:

[assembly: FabricTransportServiceRemotingProvider(MaxMessageSize = 1073741824, OperationTimeoutInSeconds = 600)]

在API和actor中。但它在5分钟后正好抛出超时错误。有没有其他方法可以增加服务结构服务/演员的超时?

下面是我在API端收到的错误:

"This can happen if message is dropped when service is busy or its long running operation and taking more time than configured Operation Timeout." 

1 个答案:

答案 0 :(得分:0)

如果工作时间比预期的要长,该怎么办?你有没有考虑过这个异步/事件驱动?

例如:

  1. 致电BeginProcessing,在演员内部安排提醒。返回一个Job-token。
  2. 提醒火灾,处理开始。
  3. 处理完成。
  4. 通知来电者(使用SignalR或类似信号),或在GetJobProgress上公开JobMonitorActor个终结点。使用Job-token进行关联。