我应该在Azure队列上的每次读/写之前调用CreateIfNotExistsAsync()吗?
我知道它会导致REST调用,但是它在队列上执行任何IO吗?
我正在将.Net库用于Azure Queue(如果此信息很重要).
解决方法:
该方法所做的只是尝试创建队列并捕获AlreadyExists错误,您可以通过在尝试访问队列时捕获404来轻松地复制自己.势必会影响性能.
更重要的是,它增加了您的成本:从Understanding Windows Azure Storage Billing – Bandwidth, Transactions, and Capacity [MSDN]起
We have seen applications that perform a CreateIfNotExist [sic] on a Queue before every put message into that queue. This results in two separate requests to the storage system for every message they want to enqueue, with the create queue failing. Make sure you only create your Blob Containers, Tables and Queues at the start of their lifetime to avoid these extra transaction costs.