Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/.net/25.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/apache/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# Azure函数在主机json文件中设置autoRenewTimeout不起作用_C#_.net_Azure_Azure Functions_Auto Renewing - Fatal编程技术网

C# Azure函数在主机json文件中设置autoRenewTimeout不起作用

C# Azure函数在主机json文件中设置autoRenewTimeout不起作用,c#,.net,azure,azure-functions,auto-renewing,C#,.net,Azure,Azure Functions,Auto Renewing,我正在使用Azure函数从队列中读取消息,这需要很长时间,为此,我在host.json文件中使用了autoRenewTimeout,但消息在处理过程中仍会重新出现在队列中 我的要求是长时间处理消息,下面是json配置文件 "version": "2.0", "logging": { "applicationInsights": { "samplingExcludedTypes&quo

我正在使用Azure函数从队列中读取消息,这需要很长时间,为此,我在host.json文件中使用了autoRenewTimeout,但消息在处理过程中仍会重新出现在队列中

我的要求是长时间处理消息,下面是json配置文件

"version": "2.0",
  "logging": {
    "applicationInsights": {
      "samplingExcludedTypes": "Request",
      "samplingSettings": {
        "isEnabled": true
      }
    }
  },
  "serviceBus": {
    // the maximum duration within which the message lock will be renewed automatically.
    "autoRenewTimeout": "05:00:00"
  },
  "functionTimeout": "05:02:00"
}

我认为您已经使用V1函数引用配置了host.json。对于V2和更高版本,配置已更改。请参阅服务总线部分,并参阅V2+的over host.json。以下只是一个示例,可根据您的需要进行调整

{
    "version": "2.0",
    "extensions": {
        "serviceBus": {
            "prefetchCount": 100,
            "messageHandlerOptions": {
                "autoComplete": true,
                "maxConcurrentCalls": 32,
                "maxAutoRenewDuration": "00:05:00"
            },
            "sessionHandlerOptions": {
                "autoComplete": false,
                "messageWaitTimeout": "00:00:30",
                "maxAutoRenewDuration": "00:55:00",
                "maxConcurrentSessions": 16
            }
        }
    }
}

检查是否有帮助。我已经通过链接并使用相同的方法将autoRenewTimeout增加到最大值,即5小时“05:00:00”,但消息仍然会重新出现在队列中。很高兴提供帮助。请你结束这篇文章好吗?