简体   繁体   English

Redis队列与MSMQ

[英]Redis queue vs MSMQ

For a long time we were using msmq and redis queue ( IRedisList ). 很长一段时间我们都在使用msmq和redis队列( IRedisList )。 Couple of month ago we started trying redis pub-sub . 几个月前,我们开始尝试redis pub-sub。

Our application has more than twenty services that read messages from queue or subscribe to channels with redis . 我们的应用程序有20多种服务,可以从队列中读取消息或使用redis订阅频道。 We also have more than ten queues that we send messages to them. 我们还有十多个队列,我们​​向他们发送消息。 The application is multi-threaded. 该应用程序是多线程的。

So what do i want from you? 那么我想要你什么?

Now we have some time to spend on deciding what kind of the queues above do we want to use and what do we want to replace with a different kind of queue. 现在我们有时间花在决定上面我们想要使用什么类型的队列以及我们想要用不同类型的队列替换什么。

I tried to look for post about MSMQ VS Redis and did not find enough information. 我试图寻找有关MSMQ VS Redis的帖子,但没有找到足够的信息。

Can someone advise me about this issue? 有人可以告诉我这个问题吗?

IMO, you are trying to compare apples and oranges here. IMO,你想在这里比较苹果和橘子。

MSMQ is an enterprise-class MOM (message oriented middleware, ie a queuing system) offering persistency, transactional support, and a rich set of features. MSMQ是一个企业级MOM(面向消息的中间件,即排队系统),提供持久性,事务支持和丰富的功能。

Redis is a fast in-memory data structure server, on which you can build a queuing system. Redis是一个快速内存数据结构服务器,您可以在其上构建排队系统。 A proper implementation of the basic features of MSMQ with Redis is already a difficult task. 使用Redis正确实现MSMQ的基本功能已经是一项艰巨的任务。 It would probably not be possible at all to implement the advanced features (like the distribution transaction support). 完全可能无法实现高级功能(如分发事务支持)。

I would suggest to try to list the properties you expect from the queuing system: 我建议尝试列出您期望从排队系统中获得的属性:

  • Do you need persistency? 你需要坚持吗?
  • Do you need transaction support? 你需要交易支持吗?
  • Do you need distributed transaction support? 您需要分布式事务支持吗?
  • Do you need "once and only once" delivery semantic? 您需要“一次且仅一次”交付语义吗? At most once? 最多一次? At least once? 至少一次?
  • Do you need multiple retry policies (linear delay, exponential backoff, etc ...)? 您是否需要多个重试策略(线性延迟,指数退避等)?
  • Do you need exception/dead queues? 你需要异常/死队吗?
  • Do you need item retention? 你需要物品保留吗?
  • Do you need queue browsing support? 您需要队列浏览支持吗? Queue administration capabilities? 队列管理功能?
  • Do you need item priority management? 您需要项目优先级管理吗?
  • Do you need automatic item expiration? 你需要自动项目到期吗?
  • Do you need delayed items? 你需要延迟物品吗?
  • Do you need item sequencing? 你需要项目排序吗? Last value queues? 最后的值队列?
  • Do you need publish-and-subscribe? 你需要发布和订阅吗? With multi-casting? 多铸?
  • Do you need to dequeue from several queues at the same time in a single thread? 您是否需要在一个线程中同时从多个队列中出队?
  • Do you need high-availability and/or clustering support? 您需要高可用性和/或群集支持吗?
  • Do you have a high-throughput? 你有高吞吐量吗? Do you need the best performance? 你需要最好的表现吗?

Depending on your requirements Redis may or may not be a good fit. 根据您的要求,Redis可能适合也可能不适合。 But do not expect to get the bells and whistles of a real MOM with Redis. 但是不要指望用Redis来获得真正的MOM的花俏。

Last point: you mentioned the Redis pub/sub feature. 最后一点:您提到了Redis发布/订阅功能。 Please note this mechanism is not at all based on a queuing system. 请注意,此机制完全不基于排队系统。 There is no guarantee about the delivery of messages with Redis pub/sub. 无法保证使用Redis pub / sub传递消息。 If a subscriber does not listen, the item will be lost for this subscriber. 如果订户不听,则该订户的项目将丢失。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM