首页 | 本学科首页   官方微博 | 高级检索  
     

RabbitMQ小消息确认机制优化
引用本文:徐震,焦文彬. RabbitMQ小消息确认机制优化[J]. 计算机系统应用, 2018, 27(3): 252-257
作者姓名:徐震  焦文彬
作者单位:中国科学院 计算机网络信息中心, 北京 100190;中国科学院大学, 北京 100049,中国科学院 计算机网络信息中心, 北京 100190
基金项目:中国科学院“十三五”信息化专项(Y72922802401)
摘    要:RabbitMQ的消息确认机制包括生产者确认(confirm)与消费者确认(ack).若消息不需要进行持久化,生产者收到确认,消息仍有可能丢失,且生产者不知道消息已丢失,消费者可能无法收到该消息.若消息需要进行持久化,生产者收到确认时,消费者可能还没有收到消息.本文对RabbitMQ的消息确认机制进行优化,在收到消费者确认后向生产者发送确认消息,消息丢失时由生产者重发消息,减少消息确认过程记录的信息.生产者收到确认即可保证消息被消费者成功接收,提高了非持久化小消息投递的可靠性.实验结果表明,在客户端数量较少时,该方法能够明显提高持久化小消息的发送速率.

关 键 词:生产者确认  消费者确认  RabbitMQ  小消息确认  性能优化
收稿时间:2017-06-27
修稿时间:2017-07-10

Optimization of Tiny Message Acknowledgement in RabbitMQ
XU Zhen and JIAO Wen-Bin. Optimization of Tiny Message Acknowledgement in RabbitMQ[J]. Computer Systems& Applications, 2018, 27(3): 252-257
Authors:XU Zhen and JIAO Wen-Bin
Affiliation:Computer Network Information Center, Chinese Academy of Sciences, Beijing 100190, China;University of Chinese Academy of Sciences, Beijing 100049, China and Computer Network Information Center, Chinese Academy of Sciences, Beijing 100190, China
Abstract:Message acknowledgement mechanism in RabbitMQ includes confirm and ack. If the message doesnot need to be persisted, when the producer receives confirmation, the message may still be lost and the producer canot know that, so consumers may not receive the message. If the message needs to be persisted, when the producer receives confirmation, the message may be on the way to consumers. This study optimizes the message acknowledgement mechanism in RabbitMQ. After optimization, confirmation is sent to the producer after receiving the ack. The producer resends the message if the message is lost. Information that needs to be recorded is reduced during the message acknowledgement process. The producer receives confirmation after consumers receive the message successfully. The reliability of transient tiny messages delivery is improved. The experimental results reveal that the method can improve the sending rate of persistent tiny messages obviously when the number of clients is small.
Keywords:confirm  ack  RabbitMQ  tiny message acknowledgement  performance optimization
点击此处可从《计算机系统应用》浏览原始摘要信息
点击此处可从《计算机系统应用》下载全文
设为首页 | 免责声明 | 关于勤云 | 加入收藏

Copyright©北京勤云科技发展有限公司  京ICP备09084417号