Message Publishing subscriptions for Redis

Source: Internet
Author: User
Tags live chat

Redis supports the Pub/sub feature (which can be used for messaging servers), which is similar to MQ, and here's a simple introduction

Pub/sub

Pub/sub literally is the release (Publish) and Subscription (Subscribe), in Redis, you can set a key value for message publishing and message subscription,
When a message is published on a key value, all clients subscribing to it receive the corresponding message. The most obvious use of this function is to use it as a real-time messaging system, such as regular live chat, group chat, and other functions.

Client 1:subscribe Rain
Client 2:publish Rain "Hello world!"
(integer) 2 indicates that several clients have subscribed to this message

To be Continued ... ..... ..... ..... ................................

Message Publishing subscriptions for Redis

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.