TAILIEUCHUNG - Introducing Windows Azure- P22

Introducing Windows Azure- P22: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 0 OnMessageReceive message 1 private MessageOueue GetXmlPayloadOueue Initialization return PAYLOAD OUEUE NAME Delete a Message from the Queue To delete a message from a queue is straightforward as Listing 3-6 shows. The method btnDelete Click is implemented in the file and is the button click event handler used to delete a message from the queue. Listing 3-6. Listen and Delete Message from a Queue Implementation const int UPDATE TIMEOUT SEC 5 protected void btnDelete Click object sender EventArgs e Message message GetXmlPayloadOueue .GetMessage UPDATE TIMEOUT SEC if message null GetXmlPayloadOueue .DeleteMessage message The reason for specifying the timeout before calling to delete a message from the queue is that having received a message that has been put into queue that message is locked for the specified timeout. If the message is not deleted within the timeout it is unlocked and becomes visible again to other queue readers. Microsoft designs this to prevent a queue reader trying to process a message and then dying as a result of an error or exception leaving the message locked. This approach is known as a loose transaction since transactions in cloud queue storage are not supported. Parse a Message Received from the Queue When a message has been received we need to parse it back to the original data format. The Message class from the Azure SDK provides functions to parse the raw message as either an array or a string as Listing 3-7 shows. 78 CHAPTER 3 WORKING WITH CLOUD QUEUE AND BLOB STORAGE Listing 3-7. Parse Message Received from a Queue into String const int UPDATE TIMEOUT SEC 5 Message message GetXmlPayloadQueue .GetMessage UPDATE TIMEOUT SEC if message null true else .

TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.