11.07.2015 Views

y - Net Developer

y - Net Developer

y - Net Developer

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

amrameshreddy.blog.com250 CHAPTER 8 ■ IMPLEMENTING RELIABLE MESSAGING AND QUEUE-BASED COMMUNICATIONSramrameshreddy.blog.combeing lost, causing you a real monetary loss. All of these scenarios are real and problematicand need to be addressed successfully to achieve reliability.Reliable messaging helps overcome some of these issues since WCF also tracks the livelinessof the available resources. This helps both the reliability and the scalability aspects ofyour application. An additional piece of functionality that reliability offers you is a networkadaptive rate of sending messages. In other words, WCF monitors the network congestion andwill either speed up or slow down the rates at which messages flow across the network, thusproviding a pseudo load-balancing functionality.Let’s dive into the implementation of reliable messaging in WCF.The Need for Reliable MessagingWhy should you be excited about reliable messaging? It certainly does not seem at first to becool, interesting, or even something to get mildly excited about.Providing reliability to messages has been somewhat of a nightmare in distributed applicationsirrespective of the transport. A lot of issues are associated with it. For example, the serversor a network connection might not be available. Even worse, the connection itself might be disruptedfor reasons that are not readily predictable. As the developer and architect, you mustdesign around these issues. If you look at the concepts of SOA in general, a key requirementthat really should be the fifth tenet of SOA is reliability. (Please refer to Chapter 1 for the fourtenets of SOA.) It is of little value to have an architecture that does not provide reliability at itscore for message communications.Reliable messaging in the context of SOA guarantees that a message will actually bereceived at the destination. To do this, you need to ensure that a destination is available. In theSOA world, this option does not exist since you might not control the destination. In the scenarioof reliable messaging, you need to compensate for the fact that messages may not arriveat the destination as intended because of unforeseen and unknown reasons. Hence, you needto hold on to the message until the destination is available and the entire message has in factpassed successfully. Finally, should something go wrong, you need to detect that an error hasoccurred, recover from it, and then resend the message, which will then be reprocessed. Thishas been extremely difficult to do in the past, and when a custom implementation has beendelivered, it has been prohibitively expensive to implement and maintain.Therefore, software industry leaders including Microsoft, IBM, BEA, and TIBCO created theWS-ReliableMessaging standard. This addresses the problem of being able to allow messages tobe delivered reliably between applications despite failures within software components, networks,or systems. You accomplish this by standardizing on the SOAP and WSDL requirementsto identify the application endpoints and bindings.WCF allows for reliable messaging in a web service environment by facilitating that messagesare delivered only once (in other words, no duplicates) and in order. However, since thestandard for message queues is not in place across the industry, Microsoft decided to buildthis capability on top of MSMQ, which provides a buffer mechanism between the client andthe service and in essence decouples them. However, reliable messaging can also be somethingof a misnomer since it does not provide for durability, unless you consider MSMQ as thecontainer.ramrameshreddyramrameshreddy

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!