C#驱动程序是否有良好的开源MongoDB队列实现 [英] Is there a good open-source MongoDB Queue Implementation for the C# Driver

查看:68
本文介绍了C#驱动程序是否有良好的开源MongoDB队列实现的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

并不是说编写一个书不够容易(或有趣),可以这么说,不要重新发明轮子是有道理的.我浏览了各种尝试,但是似乎还没有遇到支持这些条件的实现;

Not that it wouldn't be easy (or fun) enough to write one, it makes sense not to re-invent the wheel so to speak. I've had a look around at various attempts, but I don't seem to have yet come across an implementation that supports these criteria;

具有MongoDB持久性的简单队列OSS系统;

Simple queue OSS system with MongoDB persistence;

  • 基于C#驱动程序(正式)(因此完整的POCO序列化)
  • 可用光标而不是轮询
  • 处理消息超时(正确的GC)
  • 处理使用者故障(理想情况下是崩溃检测到重新插入,但是超时并带有延迟的重新插入是可以的),因此在完成后findAndModify
  • 多位作家,多位消费者
  • 线程安全

很高兴;

  • 允许(仅最新)消息(在Q中替换较旧的消息)

如果有人拥有一个很好的简单库,例如我尚未找到的在GitHub上浮动的库,请说出来!

If anyone has nice simple a library like that floating around on GitHub that I've not yet found, please speak up!

推荐答案

我有一个小项目-一个可与MS SQL队列或MongoDB一起使用的.net消息总线实现(最近增加了对MongoDB的支持).链接: http://code.google.com/p/nginn-messagebus/ http://nginn.org/blog 为例. 我不确定这是否是您要寻找的东西,它也缺少文档和示例部门,并且与您的规格不完全匹配(轮询而不是拖尾)-但也许值得一试.这是一个发布-订阅消息总线,例如NServiceBus或MassTransit,而不是原始消息队列.

There's my little project - a .net message bus implementation that works with MS SQL queues or MongoDB (MongoDB support is a recent addition). Link: http://code.google.com/p/nginn-messagebus/ and http://nginn.org/blog for some examples. I'm not sure if this is what you're looking for, it's also lacking in documentation and example departments and it doesn't exactly match your specs (polling instead of tailing) - but maybe it's worth giving a try. This is a publish-subscribe message bus, like NServiceBus or MassTransit - not a raw message queue.

PS恐怕您的规范中存在相互排斥的要求:您不能将并尾的消费者使用可尾游标,因为您失去了原子性.如果您想排长队,则应该只使用一个使用者.

PS I'm afraid there are mutually exclusive requirements in your specs: you can't use tailable cursor with concurrent consumers because you lose atomicity. If you want to tail a queue you should use only a single consumer.

这篇关于C#驱动程序是否有良好的开源MongoDB队列实现的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆