Core components of my heart ~msmq and Redis queues

Source: Internet
Author: User
Tags msmq

Back to Catalog

This article is in fact my heart of the core components of the seventh back, indeed in time some lag, but the content is not lag! MSMQ is just an introduction, I really do not want to say it, it is Microsoft's own integration of a set of message queue, hosted in the window service, stability Ten is not flattering, and Redis queue we choose the driver client is Servicestack.redis, It is chosen because it is stable, update fast, and for other drivers may not be updated for a few years, and Servicestack.redis has been to the forefront of REDIS clients!

Redis Queue Real-time and non-real time: This is said real-time and non-real-time mainly for the consumer side, the message producer in the production of messages, the Redis queue to store these messages, and when the consumption is our concern, not real-time is said to have a rotation service on the backend from the queue to get messages, This has a certain degree of delay; in real time, a long TCP connection is established on the consumer side, when the queue has data to consume it immediately, when there is no data, the thread is suspended waiting state!

Uncle Real-time Message Queuing consumer implementations (Redis queue)

         while(true)            {                varRedis = Redis.Client.RedisManager.GetClient ();//Redis Connection Pooling                if(Redis. GetListCount ("queue1") ==0)//message is empty pending{Console.foregroundcolor=Consolecolor.green; Console.WriteLine ("queue is empty, suspended for 1 seconds"); Thread.Sleep ( +); }                Else{Console.foregroundcolor=Consolecolor.yellow; Console.WriteLine ("take out the queue:"+Redis. Popitemfromlist ("queue1")); }            }

Uncle the implementation of non-real-time message queue

Non-real-time queue is mainly in the consumer side of the use of a certain scheduling mechanism, timed to the Redis queue to get data, logic is not complex, the uncle used the scheduling component or quartz.net, the reason is that it is powerful, flexible configuration, decoupling ability is stronger!

The ability to work with cron expressions is more powerful

Back to Catalog

Core components of my heart ~msmq and Redis queues

Related Article

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.