Windows Azure的PHP队列REST代理限制 [英] Windows Azure PHP Queue REST Proxy Limit
问题描述
我写的作业处理器使用的Azure SDK PHP从Windows Azure的队列存储出列。这项工作只是尝试在批处理获取32条消息,对其进行处理,然后从队列中删除的邮件,并重复上述步骤。然而,每次我运行PHP脚本中,下面的错误在循环后扔跑了整整27倍:
I am writing a job processor to dequeue from Windows Azure Queue Storage using Azure PHP SDK. The job just try to fetch 32 messages in a batch, process them, and then delete the messages from the queue, and the repeat these steps. However, for each time I run the PHP script, the errors below is throw after the loop has run for exactly 27 times:
PHP Fatal error: Uncaught HTTP_Request2_MessageException: Malformed response: in /usr/share/php/HTTP/Request2/Adapter/Socket.php on line 1013
#0 /usr/share/php/HTTP/Request2/Adapter/Socket.php(1013): HTTP_Request2_Response->__construct('', true, Object(Net_URL2))
#1 /usr/share/php/HTTP/Request2/Adapter/Socket.php(136): HTTP_Request2_Adapter_Socket->readResponse()
#2 /usr/share/php/HTTP/Request2.php(939): HTTP_Request2_Adapter_Socket->sendRequest(Object(HTTP_Request2))
#3 /usr/share/php/WindowsAzure/Common/Internal/Http/HttpClient.php(262): HTTP_Request2->send()
#4 /usr/share/php/WindowsAzure/Common/Internal/RestProxy.php(141): WindowsAzure\Common\Internal\Http\HttpClient->send(Array, Object(WindowsAzure\Common\Internal\Http\Url))
#5 /usr/share/php/WindowsAzure/Common/Internal/ServiceRestProxy.php(86): WindowsAzure\Common\Internal\RestProxy->sendContext(Object(WindowsAzure\Common\Internal\Http\HttpCallContext))
#6 /usr/share/php/WindowsAzure/Common/Internal/ServiceRestProxy.php(125): WindowsAzure\Common\Internal\ServiceRestPr in /usr/share/php/HTTP/Request2/Response.php on line 215
任何Azure的专家能帮助我吗?
Any Azure expert could help me?
推荐答案
为了绕过HTTPS的连接数限制在Azure存储操作(包括存储查询,或者说一个块BLOB分块上传),您需要设置蔚蓝色的斑点服务连接字符串为http。
In order to bypass the connection limit for HTTPS on Azure Storage operations (including the storage query, or say a block blob chunked upload), you need to set the azure blob service connection string to http.
您可以做这样的事情(假传递做多操作调用之前):
You can do something like this (pass in false before doing a multi-operation call):
function getBlobStorageProxy($secure = true) {
if ($secure) {
$connectionString = "DefaultEndpointsProtocol=https;AccountName=[AccountName];AccountKey=[AccountKey]";
} else {
$connectionString = "DefaultEndpointsProtocol=http;AccountName=[AccountName];AccountKey=[AccountKey]";
}
$this->serviceBuilder = ServicesBuilder::getInstance();
return $this->serviceBuilder->createBlobService($connectionString);
}
这篇关于Windows Azure的PHP队列REST代理限制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!