2013-05-01 23 views
0

經過5個小時的嘗試,我認爲我的Azure帳戶存在問題,導致我不能在當時使用多個隊列。無法在當時向多個Azure隊列添加郵件

我開始創建兩個小寫的小寫字母,然後檢查它們是否存在,並檢查它們的uri名稱,看起來很好。

然後我開始添加一個消息,我的第一隊列,這工作得很好,如果我檢查有多少消息隊列它給了我一個數字大於0

我再重複一模一樣的步驟添加一條消息給我的第二個隊列,但是這次我試着檢查消息的數量,它甚至不會說0,它會拋出null。

如果我從第二個隊列中使用getMessage(),它也會返回一個空消息,這意味着我添加的所有消息實際上都不會進入我的第二個隊列中的存儲。

這取決於帳戶是否有任何限制?我是否必須在azure上設置不同的東西,以便可以同時使用多個隊列分區?

感謝您提前您的答覆..

編輯

我在WCF類的頂部被定義爲:

private static CloudQueue processedqueue; 
private static CloudQueue notprocessedqueue; 

這是我InitializeStorage方法:

var queue1 = account.CreateCloudQueueClient(); 
       notprocessedqueue = queue1.GetQueueReference("notprocessedqueue"); 
       notprocessedqueue.CreateIfNotExist(); 
var queue2 = account.CreateCloudQueueClient(); 
       processedqueue = queue2.GetQueueReference("processedqueue"); 
       processedqueue.CreateIfNotExist(); 


//I have tried using queue1 to get the reference of both queues but is the same result 

該方法在負責填充隊列:

var message = new CloudQueueMessage(string.Format("{0},{1}", pWord, processed.ToString())); 

    var message2 = new CloudQueueMessage(string.Format("{0},{1}", pWord, processed.ToString())); 

processedqueue.AddMessage(message); 
notprocessedqueue.AddMessage(message2); 



processedqueue.Exists() <- Returns true 
processedqueue.Uri.ToString() <- returns a proper URL with the name I defined in the getReference method 
notprocessedqueue.Exists() <- Retruns true 
notprocessedqueue.Uri.ToString() <- returns a proper URL with the name I defined in the getReference method 

我執行的方法addMessage方法後,我嘗試以下方法:

processedqueue.ApproximateMessageCount <- returns 1 
notprocessedqueue.ApproximateMessageCount <- returns null 
+0

您是否試圖將完全相同的對象添加到其他隊列?如果您嘗試以相反的順序進行操作,會發生什麼情況。我感覺一些代碼可能需要一個正確的答案 – 2013-05-01 20:03:35

+0

它一直工作,這意味着,改變我添加消息到隊列的順序。消息是不同的,即時消息不試圖添加相同的消息到兩個隊列雖然目前他們持有相同的測試目的 – 2013-05-01 20:08:22

+0

你可以告訴我們一些代碼?一般來說,這是有效的,但取決於你如何做,你可能會遇到一些問題。 – Jaxidian 2013-05-01 20:15:02

回答

0

最後,它的工作,我所做的就是格式化虛擬硬盤驅動器在我的解決辦法存儲在工作者角色中,然後在Azure Managament門戶中單擊「恢復爲默認值」,然後重新啓動計算機並重新部署我的解決方案。

它現在像魅力一樣工作,顯然工作人員的角色受到了某種程度的嘲弄。

相關問題