当前位置:网站首页>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
边栏推荐
- SSDB foundation 2
- The platinum library cannot search the debug process records of some projection devices
- SSDB基础1
- Minesweeping II of souI instance
- Oracle configuration st_ geometry
- PostgreSQL
- 2022.04.23 (the best time for lc_714_to buy and sell stocks, including handling charges)
- JS controls the file type and size when uploading files
- Partage de la conception de l'alimentation électrique de commutation et illustration des compétences en conception de l'alimentation électrique
- Accessing private members using templates
猜你喜欢
I just want to leave a note for myself
From technical system to business insight, the closing chapter of the practice of small and medium-sized R & D team structure
binlog2sql 工具安装使用及问题汇总
Solutions such as unknown or garbled code or certificate problem prompt in Charles's mobile phone packet capture, actual measurement.
8266 obtain 18b20 temperature
Simple use of navigation in jetpack
[record] typeerror: this getOptions is not a function
RuntimeError: Providing a bool or integral fill value without setting the optional `dtype` or `out`
简化路径(力扣71)
Android Development: the client obtains the latest value in the database in real time and displays it on the interface
随机推荐
One of the reasons why the WebView web page cannot be opened (and some WebView problem records encountered by myself)
js上传文件时控制文件类型和大小
Coordinate conversion WGS-84 to gcj-02 and gcj-02 to WGS-84
redis优化系列(三)解决主从配置后的常见问题
c#:泛型反射
点云数据集常用处理
Sogou cell thesaurus analysis (only extract words and word frequency)
mysql_linux版本的下載及安裝詳解
RuntimeError: Providing a bool or integral fill value without setting the optional `dtype` or `out`
Common SQL commands
【C语言进阶11——字符和字符串函数及其模拟实现(2))】
Switching power supply design sharing and power supply design skills diagram
[advanced level 11 of C language -- character and string functions and their simulation implementation (2)]
c1000k TCP 连接上限测试1
OpenHarmony开源开发者成长计划,寻找改变世界的开源新生力!
优先使用组合而不使用继承
Modify the font size of hint in editext
Customize the non slidable viewpage and how to use it
机器学习目录
Introduction to micro build low code zero Foundation (lesson 3)