本文已被:浏览 2859次 下载 2722次
Received:June 27, 2017 Revised:July 10, 2017
Received:June 27, 2017 Revised:July 10, 2017
中文摘要: RabbitMQ的消息确认机制包括生产者确认(confirm)与消费者确认(ack).若消息不需要进行持久化,生产者收到确认,消息仍有可能丢失,且生产者不知道消息已丢失,消费者可能无法收到该消息.若消息需要进行持久化,生产者收到确认时,消费者可能还没有收到消息.本文对RabbitMQ的消息确认机制进行优化,在收到消费者确认后向生产者发送确认消息,消息丢失时由生产者重发消息,减少消息确认过程记录的信息.生产者收到确认即可保证消息被消费者成功接收,提高了非持久化小消息投递的可靠性.实验结果表明,在客户端数量较少时,该方法能够明显提高持久化小消息的发送速率.
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.
文章编号: 中图分类号: 文献标志码:
基金项目:中国科学院“十三五”信息化专项(Y72922802401)
引用文本:
徐震,焦文彬.RabbitMQ小消息确认机制优化.计算机系统应用,2018,27(3):252-257
XU Zhen,JIAO Wen-Bin.Optimization of Tiny Message Acknowledgement in RabbitMQ.COMPUTER SYSTEMS APPLICATIONS,2018,27(3):252-257
徐震,焦文彬.RabbitMQ小消息确认机制优化.计算机系统应用,2018,27(3):252-257
XU Zhen,JIAO Wen-Bin.Optimization of Tiny Message Acknowledgement in RabbitMQ.COMPUTER SYSTEMS APPLICATIONS,2018,27(3):252-257