当前位置:网站首页>What is a message queue
What is a message queue
2022-04-23 19:15:00 【Sound God】
“ Message queue ” It's a container that holds messages during their transmission .
Introduction to message queuing
Message queue ( English :Message queue) It is a kind of communication between processes or between different threads of the same process , The storage column of software is used to process a series of inputs , It's usually from users .
Message queuing provides asynchronous communication protocol , The records in each column contain detailed data , Including when it happened , Type of input device , And specific input parameters , in other words : The sender and receiver of the message do not need to interact with the message queue at the same time . The message is kept in the queue , Until the receiver gets it back .
“ news ” A unit of data transmitted between two computers . The message can be very simple , For example, only text strings ; It can be more complicated , May contain embedded objects .
The message is sent to the queue .“ Message queue ” It's a container that holds messages during their transmission . The message queue manager acts as an intermediary when relaying messages from its source to its destination . The main purpose of queues is to provide routing and ensure the delivery of messages ; If the recipient is not available when sending a message , Message queues keep messages , Until it can be successfully delivered .
Features of message queuing
1. asynchronous : The message queue itself is asynchronous , No need to wait for a response .( Asynchronous features of message queues , It also creates a disadvantage , That is, the receiver must poll the message queue , To receive the latest news )
2. decoupling : Message queuing reduces the coupling between services , Different services can communicate through message queues , Instead of caring about each other's implementation details , Just define the format of the message .
3. radio broadcast : One of the basic functions of message queuing is to broadcast . If there is no message queue , Whenever a new business party accesses , We all need a joint debugging of the new interface . With message queuing , We just need to care if the message has reached the queue , As for who wants to subscribe , It's downstream , Undoubtedly, it greatly reduces the workload of development and joint commissioning .
4. Peak shaving and flow control
When there is a gap between the processing capacity of upstream and downstream systems , Make a general use of message queuing ” carrier ”. When the downstream has the ability to handle , Re distribution and processing .
Message queuing mode
At present, message queuing is mainly used 2 Patterns , Respectively “ Point to point mode ” and “ Release / A subscription model ”.
Point to point mode :
When a message is processed by a messenger , This message will be locked or removed on the queue and other consumers will not be able to process it . If a consumer fails to process a message , The message system usually puts the message back on the queue , So that other consumers can continue to deal with .
Release / A subscription model :
A single message can be acquired and processed concurrently by multiple subscribers . Generally speaking , There are two types of subscriptions .
1. temporary (ephemeral) subscribe , This subscription exists only when the consumer is up and running . Once the consumer exits , The corresponding subscription and messages that have not yet been processed will be lost .
2. persistent (durable) subscribe , This kind of subscription will always exist , Unless you take the initiative to delete . After the consumer exits , The messaging system will continue to maintain the subscription , And subsequent messages can be processed .
Commonly used message queue middleware
Kafka:
Apache Kafka It was originally made by LinkedIn Based on the unique design, the company implements a distributed submission log system ( a distributed commit log), Then become Apache Part of the project . The killer mace of big data , When it comes to message transmission in the field of big data , You can't get around it Kafka, This message middleware for big data , With its millions TPS We have a reputation for throughput , Quickly become the darling of big data , In data collection 、 transmission 、 The storage process plays an important role .
RabbitMQ:
RabbitMQ 2007 Released in , It's using Erlang Open source message queuing system developed by language , be based on AMQP Protocol to implement .AMQP The main feature is message oriented 、 queue 、 route ( Including point-to-point and release / subscribe )、 reliability 、 Security .AMQP Protocols are more used in enterprise systems , For data consistency 、 Scenarios requiring high stability and reliability , The performance and throughput requirements are still second .
RocketMQ:
Alibaba's open source message middleware , It's pure Java Development , High throughput 、 High availability 、 Features suitable for large-scale distributed system applications .RocketMQ Thought originated from Kafka, But it is not Kafka One of the Copy, It optimizes the reliable transmission and transaction of messages , At present, Alibaba group is widely used in transactions 、 Recharge 、 Flow calculation 、 Message push 、 Log streaming 、binglog Distribution and other scenarios .
ActiveMQ:
yes Apache Produce , One of the most popular , Powerful open source message bus . The official community is right now ActiveMQ 5.x Less maintenance , Less used in large-scale throughput scenarios .
版权声明
本文为[Sound God]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204231913518436.html
边栏推荐
- Openlayers 5.0 loading ArcGIS Server slice service
- Openlayers 5.0 thermal diagram
- Coordinate conversion WGS-84 to gcj-02 and gcj-02 to WGS-84
- 【玩转Lighthouse】腾讯云轻量服务器搭建全平台视频解析视频下载网站
- I just want to leave a note for myself
- MySQL Téléchargement et installation de la version Linux
- One of the reasons why the WebView web page cannot be opened (and some WebView problem records encountered by myself)
- Wechat applet part of the mobile phone Preview PDF did not respond
- [today in history] April 23: the first video uploaded on YouTube; Netease cloud music officially launched; The inventor of digital audio player was born
- SQL Server database in clause and exists clause conversion
猜你喜欢
The platinum library cannot search the debug process records of some projection devices
White screen processing method of fulter startup page
Client interns of a large factory share their experience face to face
[today in history] April 23: the first video uploaded on YouTube; Netease cloud music officially launched; The inventor of digital audio player was born
8266 obtain 18b20 temperature
Simple use of navigation in jetpack
Introduction to micro build low code zero Foundation (lesson 3)
2022.04.23 (the best time for lc_714_to buy and sell stocks, including handling charges)
Matlab 2019 installation of deep learning toolbox model for googlenet network
Use of fluent custom fonts and pictures
随机推荐
js获取本机ip地址
Network protocol: SCTP flow control transmission protocol
SSDB基础2
Translation of audio signal processing and coding: Preface
2022.04.23(LC_763_划分字母区间)
Pit encountered using camera x_ When onpause, the camera is not released, resulting in a black screen when it comes back
openlayers draw矩形
[report] Microsoft: application of deep learning methods in speech enhancement
Common SQL commands
Solutions such as unknown or garbled code or certificate problem prompt in Charles's mobile phone packet capture, actual measurement.
Simple use of navigation in jetpack
Solve the problem of invalid listview Click
On the forced conversion of C language pointer
Switching power supply design sharing and power supply design skills diagram
From technical system to business insight, the closing chapter of the practice of small and medium-sized R & D team structure
SQL of contention for system time plus time in ocrale database
Some speculation about the decline of adults' language learning ability
Some records used by VS2010
12个例子夯实promise基础
Coordinate conversion WGS-84 to gcj-02 and gcj-02 to WGS-84