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.

CHAPTER 9 ■ USING TRANSACTIONS IN WCF 297ramrameshreddy.blog.comThis means that should the machine crash, any messages that existed are lost. On the otherhand, MSMQ, as a technology independent of WCF, provides you with a transport that is bothreliable and durable. Messages that have persisted to the queue survive machine reboots andare lost only in the event of a catastrophic hardware failure. In the current scenario, you canbenefit from this feature where the client has passed on the messages to MSMQ and the tradeservice is not available. To simulate a failure scenario, you could reboot the machine and thenstart TradeService, and the messages would be delivered successfully. MSMQ also providesyou with the means of decoupling the transport from the application. By doing this, MSMQcan open up a whole new world of scenarios for integration. An application at the end of thequeue may or may not be a WCF application or even a Windows-based application. The onlyrequirement is that it is able to communicate with MSMQ. This decoupling of the transportfrom the application, as well as the availability of a durable store for the application, providesyou the tools to build highly resilient enterprise applications without having to write code,since the Windows platform provides you with the functionality out of the box.Figure 9-7. The client placing messages on the queue■Note WCF provides support for integrating with MSMQ out of the box. However, queues are possible evenwithout MSMQ, and you could decide to write your own queue provider. Technically, it would be possible tointeract with your queue provider if it provides an API that WCF understands. This, although technically possible,is extremely difficult to accomplish. Please refer to http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msmq/html/ff917e87-05d5-478f-9430-0f560675ece1.asp forfurther details about the MSMQ provider. To get started with building custom queue providers, refer tohttp://www.wsmq.com/. WSMQ is an open source initiative to provide a web service–based messagequeue and will help you get started in writing your own queues.ramrameshreddyramrameshreddyWhen you do start an instance of the trade service, the messages are passed on to theservice by the queue, as shown in Figure 9-8.

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

Saved successfully!

Ooh no, something went wrong!