WCF Series 5-day crash-the second day of binding use (2)

Source: Internet
Author: User
Tags msmq

Original: WCF Series 5-day crash-the second day of binding use (2)

To undertake the previous chapter, today, the application of MSMQ in actual combat projects. As we all know, to prevent the loss of orders, we are using order over MSMQ.

The benefits of MSMQ are personally considered: innate asynchronous message sending and natural automatic load balancing.

Well, look at the application of MSMQ in combat.

The first step: Prepare, install the MSMQ server, and then tick the option to install.

Step Two: Create a new Class library. Established two file Iorder.cs,order.cs. As follows.

Step Three: Create the console program for the host and build the app. Config file as follows.

Fourth step: In the console program: ①: Create queue. ②: Turn on the service.

The last step: Create a new console program as a client to test MSMQ, this time we generate the instance through "channel".

①: Let the host service off line, we insert 100 order to see how MSMQ reacts.

Yes, the number of messages is the 100 order information that my client inserted.

②: This time, I'll reboot host and let the service end on line. See what happens with MSMQ.

Yes, when MSMQ discovers that my WCF is turned on, the message is all in my "1.txt" file.

Finally, the project diagram is presented:


WCF Series 5-day crash-the second day of binding use (2)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.