我有这个简单的代码:
public void addMessage(string msg, string queueName)
{
CloudQueueMessage message = new CloudQueueMessage(msg);
try {
CloudQueue queue = getQueue(queueName);
bool exists = queue.Exists();
queue.AddMessage(message);
}
catch (Exception e) {
e.ToString();
}
}
public CloudQueue getQueue(string queueName)
{
CloudQueueClient queueClient = storageAccount.CreateCloudQueueClient();
CloudQueue queue = queueClient.GetQueueReference(queueName);
queue.CreateIfNotExists();
return queue;
}
消息设置正确,队列名称正确,队列存在,但在调用queue.AddMessage(message)
后,队列仍为空,并且不会抛出异常。怎么可能?使用Blob和Table一切正常(插入,删除等)。我实在无法解释这一点。