当前位置:网站首页>AMQP protocol
AMQP protocol
2022-06-23 17:26:00 【User 7353950】
The opening
When it comes to message queuing , I believe you are not new . In fact, everyone has used it in their daily work . It is believed that most of the R & D is just staying in the process of using message queues , The knowledge points inside are not very systematic , Some powerful functions may not be accessible due to the business form or business level of the company . That's what old cats do at work , What is used MQ All are encapsulated by architects , Simply call . In order to better understand why , So the old cat took the time to sort it out MQ A series of knowledge points , It is said that “ Bad writing is better than good memory ”, So the old cat recorded it in the process of learning . Share it with friends in need , Of course, it is also convenient for you to consult later , So there is this series of articles .
AMQP Protocol Brief
Many of you have come into contact with RabbitMq, Actually RabbitMq Namely AMQP An implementation of the protocol .
Rather than AMQP It's a protocol , In fact, it is a standard . Is an open standard for application layer protocols , Designed for message-oriented middleware .AMQP It's a network protocol that delivers asynchronous messages between processes . Its full name is AMQP(Advanced Message Queuing Protocol). The client and message middleware based on this protocol can deliver messages , Not by the client / Different middleware products , Restrictions on different development languages and other conditions .AMQP The main feature is message oriented 、 queue 、 route ( Including point-to-point and release / subscribe )、 reliability 、 Security .AMQP The behavior of the message provider and the client is mandatory , This enables different vendors to truly realize interoperability .
About Kafka and AMQP Add a separate point
I believe that in our daily work, in addition to RabbitMQ Besides, many friends have used it kafka Well , that kafka and AMQP What does it matter ?
The answer is : No problem .
Kafka Not a message queue at all . Officially ,Kafka It's a streaming platform (stream processing platform).Kafka It was designed to support high throughput log processing , It just happens to be able to implement most of the functions of message queuing .Kafka Used “ Black science and technology ”( For example, zero copy / Memory mapping , And right page cache The use of , Of course, these follow-up sharing kafka And then synchronize with the little buddy when you get there ) They are out of the scope of the standard message queue design , So we can't simply think of Kafka Than RabbitMQ Etc AMQP Better message queuing for . for example ,RabbitMQ Support dead letter queue 、 Delay queue 、 Priority queue 、 multi-tenancy 、 Push mode consumption, etc ,Kafka They don't support .
AMQP and JMS The difference between
Speaking of AMQP agreement , You have to talk JMS.JMS It is an attempt to standardize the early message oriented middleware , It's just API Level has been standardized . Only applicable to Java The message oriented middleware specification of the platform , Support Java Message exchange between applications . And by providing standard production 、 send out 、 The interface to receive messages simplifies the development of enterprise applications . If you want to know more about JMS In fact, Baidu Encyclopedia has a very detailed explanation . The specific links :https://baike.baidu.com/item/JMS/2836691?fr=aladdin, In addition, if a small partner wants its specific interface document , You can download here :https://download.oracle.com/otndocs/jcp/7195-jms-1.1-fr-spec-oth-JSpec/
JMS A brief summary
JMS It mainly includes two models ,(1) Point to point model (2) Publish and subscribe model
Point to point : The producer sends a message to the queue. Only one listener can get the message .
Publish subscribe : The producer delivers a message to the queue , All subscribers listening to the queue can get the message .
JMS Five different message body formats
JMS Five different message body formats are defined , And the type of message called , Allows you to send and receive data in different forms , Provides some level of compatibility with existing message formats .
- StreamMessage – Java Data flow of original value
- MapMessage– A set of names - It's worth it
- TextMessage– A string object
- ObjectMessage– A serialized Java object
- BytesMessage– One byte data flow
AMQP Model generalization
AMQP Model as follows
- Server: also called Broker, Accept client connections , Realization AMQP Physical services .
- Connection: Connect , Application and Broker The Internet connection .
- Channel: Network channel . Almost all operations are in Channel In the middle of ,Channel It's a channel for reading and writing messages . The client can create multiple Channel, Every Channel Represents a conversational task .
- Message: news , Data transferred between the server and the application , from Properties and body form ,Properties You can decorate the message , For example, the priority of a message 、 Advanced features like delay ;Body Is the message body .
- Virtual host: Virtual address , Due to logical isolation , Top level message routing . One Virtual Host There can be several Exchange and Queue, The same Virtual Host It can't have the same name Exchange or Queue.
- Exchange: Switch , receive messages , Forward the message to the bound queue according to the routing key .
- Binding:Exchange and Queue Virtual connection between ,binding Can contain routing Key.
- Routing Key: A routing rule , Virtual machines can use it to determine how to route a particular message .
- Queue: Also known as Message Queue, Message queue , Save messages and forward them to consumers .
AMQP and JMS contrast
The above has made some simple generalizations , If you feel that you are lacking , Not too complete , Then you can consult relevant information by yourself .
Contrast direction | JMS | AMQP |
|---|---|---|
Definition | Java API | agreement |
Cross language | no | yes |
Cross platform | no | yes |
Contrast the model | ①Peer-2-Peer( Point to point );②Pub/sub( Publish subscribe ) | ①direct exchange;②fanout exchange;③topic change;④headers exchange;⑤system exchange. In essence , The last four and JMS Of pub/sub The model doesn't make much difference , Only in the routing mechanism to do a more detailed division ;( This follow-up old cat will share with you rabbitMq I'll talk about it in detail ) |
Message type | Support multiple message types , We mentioned above | byte[]( Binary system ) |
边栏推荐
- How about stock online account opening and account opening process? Is online account opening safe?
- ELK日志收集系统部署
- A number of individual stocks in Hong Kong stocks performed actively, triggering investors' speculation and concern about the recovery of the Hong Kong stock market
- Opengauss database source code analysis series articles -- detailed explanation of dense equivalent query technology (Part 2)
- Look, this is the principle analysis of modulation and demodulation! Simulation documents attached
- Another breakthrough! Alibaba cloud enters the Gartner cloud AI developer service Challenger quadrant
- The Google play academy team PK competition is in full swing!
- 谈谈redis缓存击穿透和缓存击穿的区别,以及它们所引起的雪崩效应
- Here comes the official zero foundation introduction jetpack compose Chinese course!
- 10分钟后性能测试瓶颈调优!想进大厂这个必须会
猜你喜欢

Hands on data analysis unit 2 section 4 data visualization

官方零基础入门 Jetpack Compose 的中文课程来啦

Intranet penetration token stealing

ASEMI超快恢复二极管ES1J参数,ES1J封装,ES1J规格

使用Jmeter进行性能测试及性能监控平台搭建

图扑软件数字孪生挖掘机实现远程操控

10分钟后性能测试瓶颈调优!想进大厂这个必须会

Safe and comfortable, a new generation of Qijun carefully interprets the love of the old father

What can the accelerated implementation of digital economy bring to SMEs?

测试的重要性及目的
随机推荐
How to select an oscilloscope? These 10 points must be considered!
The R language uses the RMSE function of the yardstick package to evaluate the performance of the regression model, the RMSE of the regression model on each fold of each cross validation (or resamplin
Intel arc A380 graphics card message summary: the entry-level price products of running point and bright driving need to be optimized
NLP paper reading | improving semantic representation of intention recognition: isotropic regularization method in supervised pre training
10分钟后性能测试瓶颈调优!想进大厂这个必须会
美团三面:聊聊你理解的Redis主从复制原理?
[go]沙盒环境下调用支付宝扫码支付
Here comes the official zero foundation introduction jetpack compose Chinese course!
Jmeter压力测试教程
Date to localdatetime
B. AND 0, Sum Big-Codeforces Round #716 (Div. 2)
Digital twin excavator of Tupu software realizes remote control
How can the points mall make profits
[30. concatenate substrings of all words]
[untitled] Application of laser welding in medical treatment
【网络通信 -- WebRTC】WebRTC 源码分析 -- PacingController 相关知识点补充
ERP管理系统的重要性
Codeforces Round #620 (Div. 2)ABC
hands-on-data-analysis 第二单元 第四节数据可视化
C#与数据库连接