Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ
Tải xuống
Introducing Windows Azure- P25:The cloud platform is getting more and more attractive to the computing world. Today, service-oriented architecture (SOA) and aspect-oriented programming (AOP) techniques are widely used in enterprise solutions. A question an IT management team or a software development team may ask is, what is the next trend going to be? Cloud computing seems to be the right answer. | CHAPTER 3 WORKING WITH CLOUD QUEUE AND BLOB STORAGE return RoleStatus.Healthy private void Initialization if initialized return lock syncObj try Instatiate BlobStorage blobStorage BlobStorage.Create StorageAccountInfo .GetDefaultBlobStorageAccountFromConfiguration blobContainer blobStorage.GetBlobContainer WorkerRole.PAYLOAD BLOB CONTAINER NAME Make the container public so that we can hit the URLs from the web blobContainer.CreateContainer new NameValueCollection ContainerAccessControl.Public Instatiate QueueStorage queueStorage QueueStorage.Create StorageAccountInfo .GetDefaultQueueStorageAccountFromConfiguration queueStorage.RetryPolicy RetryPolicies.RetryN 3 TimeSpan.FromSeconds 5 Create a queue to listen blob create request message and register the events MessageQueue requstQueue queueStorage.GetQueue PAYLOAD CREATE REQUEST QUEUE NAME requstQueue.CreateQueue requstQueue.MessageReceived new MessageReceivedEventHandler OnCreateBlobMessageReceive requstQueue.PollInterval POLLING INTERVAL requstQueue.StartReceiving Create a queue without to register any event to send the blob created message with blob name to the queue MessageQueue resultsQueue queueStorage.GetQueue PAYLOAD RESULTS QUEUE NAME resultsQueue.CreateQueue Create a queue to listen blob delete request message and register the events MessageQueue deleteQueue 93 CHAPTER 3 WORKING WITH CLOUD QUEUE AND BLOB STORAGE queueStorage.GetQueue PAYLOAD DELETE QUEUE NAME deleteQueue.CreateQueue deleteQueue.MessageReceived new MessageReceivedEventHandler OnDeleteBlobMessageReceive deleteQueue.PollInterval POLLING INTERVAL deleteQueue.StartReceiving initialized true catch Exception ex LogError string.Format 0 Initialization exception caught 1 this.ToString ex.Message initialized true private void CreateBlob Message message lock syncObj string logMessage string.Format 0 OnMessageReceive message 1 this.ToString message.ContentAsString System.Diagnostics.Trace.WriteLine logMessage Log logMessage string blobName .