当前位置:网站首页>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
边栏推荐
- PostgreSQL
- Solve the problem of invalid listview Click
- @Analysis of conditional on Web Application
- Yyds dry goods inventory stringprep --- Internet string preparation
- 【C语言进阶11——字符和字符串函数及其模拟实现(2))】
- 深度学习环境搭建步骤—gpu
- SSDB基础3
- Wechat video extraction and receiving file path
- The difference between ordinary inner class and static inner class
- Screen right-click menu in souI
猜你喜欢
2022.04.23 (the best time for lc_714_to buy and sell stocks, including handling charges)
Use of fluent custom fonts and pictures
The platinum library cannot search the debug process records of some projection devices
JVM的类加载过程
Keysight has chosen what equipment to buy for you
An algorithm problem was encountered during the interview_ Find the mirrored word pairs in the dictionary
优先使用组合而不使用继承
Switching power supply design sharing and power supply design skills diagram
微搭低代码零基础入门课(第三课)
Openharmony open source developer growth plan, looking for new open source forces that change the world!
随机推荐
redis优化系列(三)解决主从配置后的常见问题
OpenHarmony开源开发者成长计划,寻找改变世界的开源新生力!
JS controls the file type and size when uploading files
Common SQL commands
Convert string to JSON
Sword finger offer II 116 Number of provinces - spatial complexity O (n), time complexity O (n)
mysql_linux版本的下载及安装详解
高层次人才一站式服务平台开发 人才综合服务平台系统
PostgreSQL
The type initializer for ‘Gdip‘ threw an exception
Screen right-click menu in souI
SSDB Foundation
The platinum library cannot search the debug process records of some projection devices
Quick start to static class variables
Switching power supply design sharing and power supply design skills diagram
Android Development: the client obtains the latest value in the database in real time and displays it on the interface
JS calculation time difference
SQL of contention for system time plus time in ocrale database
SSDB基础
Codeforces Round #783 (Div. 2) D题解