我一直試圖在dev架構中運行角色時訪問雲中的隊列。要做到這一點,我遵循了以下步驟:在本地測試中使用雲存儲在Windows Azure上使用Eclipse Eclipse
Project-> Proprieties-> Windows Azure-> Data Storage和我選擇了approrpiate字段並輸入了我的憑據。
然後我執行以下操作:
require_once 'Microsoft/WindowsAzure/Storage/Queue.php';
$storageClient = new Microsoft_WindowsAzure_Storage_Queue();
if(!($storageClient->queueExists('worktodo'))){
$result=$storageClient->createQueue('worktodo');
echo 'Created queue: ' . $result->Name."<br/>";
}else{
echo 'worktodo queue exists'."<br/>";
}
$storageClient->putMessage('worktodo', $id.','.$name, 3600); // 3600 = time-to-live of the message, if omitted defaults to 7 days
echo($storageClient->getAccountName());
長話短說隊列中DevStorage總是創建....我的配置設置:
<ConfigurationSettings>
<Setting name="StorageAccountName" value="myaccoutnt/>
<Setting name="StorageAccountKey" value="mykey"/>
<Setting name="SqlAzureHost" value=""/>
<Setting name="SqlAzureUserName" value=""/>
<Setting name="SqlAzurePassword" value=""/>
<Setting name="SqlAzureDatabase" value=""/>
<Setting name="UseDataStorage" value="true"/>
<Setting name="UseDevelopmentStorage" value="false"/>
<Setting name="UseCloudStorage" value="true"/>
<Setting name="UseSqlAzure" value="false"/>
<Setting name="LogLevel" value="Error"/>
<Setting name="ScheduledTransferPeriodInSeconds" value="30"/>
<Setting name="WindowsAzureStorageConnectionString" value="DefaultEndpointsProtocol=http;AccountName=myaccount;AccountKey=mykey"/>
<Setting name="XDrives" value=""/>
<Setting name="XDrivesLocalCache" value=""/>
</ConfigurationSettings>
有沒有人這樣做呢?我的配置設置是否正確?
感謝
至少,你錯過了一個問題。 – 2010-11-02 23:45:45
我認爲這個問題是「我該如何做這項工作?」 – smarx 2010-11-03 01:25:46
@McWafflestix請參閱添加的「?」 – jlezard 2010-11-03 09:40:59