为分布式系统发送和处理消息的可靠方法

发布于 2024-08-03 06:58:29 字数 448 浏览 2 评论 0原文

我正在开发一个小型分布式系统,它完全是消息驱动的。现在,我通常在每次必须发送内容时打开一个套接字,然后立即关闭它。状态仅在服务器端维护(例如,如果客户端 5 分钟内没有消息到达,则认为它已死亡)。

但是,我还必须在客户端上对消息进行一些低级调度(如果状态消息无法到达服务器,请重试,如果仍然失败,则假设服务器已关闭,切换到不同的服务器等)因为必须手动监听客户端和服务器(加上交换如何从服务器到达客户端的信息)。我还计划添加某种广播系统,但这开始堆积......所以问题是,是否有一些现有的.NET总线/消息传递系统可以与Mono和Microsoft一起使用,来处理这种消息传递东西?我查看了 NServiceBus,但它依赖于 MSMQ(仍然如此?),Mono 或多或少支持 MSMQ;总而言之,NServiceBus 看起来已经有点太重量级了。理想情况下,系统将支持 1:1 和 1:N 连接,稳健地处理错误并报告错误,并且还具有一些高级功能(排队消息、安全性)。

I'm working on a small distributed system, which is completely message driven. Right now, I usually open up a socket each time I have to send something and close it right afterwards. State is only maintained on the server side (for instance, if no message arrives for 5 minutes from a client, consider it dead).

However, I have to do some low-level scheduling of messages on the client as well (if a status message cannot reach the server, retry, if still fails, assume server is down, switch to different server, etc.), as well as having to manually listen on both client and server (plus exchanging the information how to reach the client from the server). I'm also planning to add some kind of broadcast system, but this is starting to pile up ... so the question is, is there some existing bus/messaging system for .NET that works with Mono and Microsoft, which handles this messaging stuff? I looked at NServiceBus, but it depends on MSMQ (still true?), which is more-or-less supported on Mono; all in all, NServiceBus already looks a bit too heavyweight. Ideally, the system would support 1:1 and 1:N connections, robustly handle errors and report them, and have some advanced features as well (queueing messages, security).

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

生来就爱笑 2024-08-10 06:58:29

您是否研究过RabbitMQ

Have you looked into RabbitMQ?

难如初 2024-08-10 06:58:29

Marc Gravellprotobuf-net 库。谷歌的协议缓冲区支持多种语言。

Marc Gravell's protobuf-net library. Googles protocol buffers has support for lots of languages.

茶花眉 2024-08-10 06:58:29

您看过 Mono-Olive 吗?我知道他们正在实现 WCF,如果他们现在已经实现了足够有用的功能,那么这可能是您的最佳选择。

Have you taken a look at Mono-Olive? I know they were implementing WCF, this would probably be your best option if they have implemented enough to be useful by now.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文