我需要一个高性能的消息总线为我的应用程序,所以我正在评估ZeroMQ
,RabbitMQ
和Apache Qpid
.为了衡量性能,我正在运行一个测试程序,该程序使用其中一个消息队列实现发布说10,000条消息,并在同一台机器上运行另一个进程来使用这10,000条消息.然后我记录发布的第一条消息和收到的最后一条消息之间的时差.
以下是我用于比较的设置.
RabbitMQ
:我使用了"扇出"类型交换和具有默认配置的队列.我使用了RabbitMQ C客户端库.ZeroMQ
:我的发布者tcp://localhost:port1
使用ZMQ_PUSH
套接字发布,My broker侦听tcp://localhost:port1
并将消息重新发送到tcp:// localhost:port2,我的消费者tcp://localhost:port2
使用ZMQ_PULL
套接字侦听.我正在使用代理而不是对等通信ZeroMQ
来使性能比较公平到使用代理的其他消息队列实现.Qpid
C++消息代理:我使用了"扇出"类型交换和具有默认配置的队列.我使用了Qpid C++客户端库.以下是效果结果:
RabbitMQ
:接收10,000条消息大约需要1秒钟.ZeroMQ
:接收10,000条消息大约需要15毫秒.Qpid
:接收10,000条消息大约需要4秒钟.问题:
RabbitMQ
或Qpid
使其性能更好?注意:
测试是在具有两个分配处理器的虚拟机上完成的.结果可能因硬件而异,但我主要对MQ产品的相对性能感兴趣.
I'm new to Mass Transit and I would like to understand if it can helps with my scenario. I'm building a sample application implemented with a CQRS event sourcing architecture and I need a service bus in order to dispatch the events created by the command stack to the query stack denormalizers.
Let's suppose of having a single aggregate in our domain, let's call it Photo, and two different domain events: PhotoUploaded and PhotoArchived.
Given this scenario, we …