简体   繁体   English

Async Majordomo模式(Netmq)

[英]Async Majordomo pattern (Netmq)

I'm using Netmq to implement a reliable, fast and high available communication between my Frontend and Backend. 我正在使用Netmq在我的前端和后端之间实现可靠,快速和高可用的通信。

Communications flows are: - A client connects (xmpp client, websockets or any other client type) and sends a message to a backend and this messages has to be processed by a specific type of worker (xmpp dispatcher process xmpp messages) - A dispatcher connects (xmpp dispatcher for example) and sends a message to a specific frontend client (xmpp client). 通信流是: - 客户端连接(xmpp客户端,websockets或任何其他客户端类型)并将消息发送到后端,此消息必须由特定类型的工作程序处理(xmpp调度程序进程xmpp消息) - 调度程序连接(例如xmpp调度程序)并将消息发送到特定的前端客户端(xmpp客户端)。

So communication can be initiated by the top (client) or by the bottom (dispatcher). 因此,通信可以由顶层(客户端)或底层(调度员)发起。

In order to achieve the above objectives, here is an architecture mockup: 为了实现上述目标,这里是一个架构模型: 通信图

As a result of what I've been reading on http://zguide.zeromq.org/page:all , this is not yet reliable, since an certain client receives a messages sends to the frontend (broker) and this message is accepted before knowing if there is any dispatcher that can process my work. 由于我在http://zguide.zeromq.org/page:all上阅读的内容,这还不可靠,因为某个客户端收到一条消息发送到前端(经纪人)并且此消息被接受在知道是否有任何调度员可以处理我的工作之前。 At this stage I can either discard this message or store it, to be process in the future when a worker is available. 在这个阶段,我可以丢弃此消息或将其存储,以便将来在工作人员可用时进行处理。 This isn't a nice solution, since if Broker as no-one to deliver the traffic for a long time a lot of messages will be accumulated on the broker. 这不是一个很好的解决方案,因为如果Broker作为没有人长时间交付流量,很多消息将在代理上累积。 The correct behaviour is: broker should not accept any message from the client or the client should stop sending messages. 正确的行为是:代理不应接受来自客户端的任何消息,否则客户端应停止发送消息。

This is the behaviour that I would like to achieve. 这是我想要实现的行为。 In order to get that I need to implement Majordomo Pattern right? 为了得到我需要实现Majordomo模式吧? And probably Majordomo Management Interface right? 可能Majordomo管理界面对吗? The problem is I cant find any good examples of C# Majordomo implementations, only C, C++ and Python examples. 问题是我找不到C#Majordomo实现的任何好例子,只有C,C ++和Python的例子。 Is there any implementations available of Majordomo pattern on Netmq or any other C# ZMQ Binding? 在Netmq或任何其他C#ZMQ Binding上是否有可用的Majordomo模式? It would be awesome to have that, since is very complex to implement Majordomo just using Netmq and I'm kind new in this area. 拥有它真是太棒了,因为使用Netmq实现Majordomo是非常复杂的,而且我在这个领域是新的。

I also searched, currently there is no example, you can take a look at the existing example at: https://github.com/zeromq/netmq/tree/master/src/Samples . 我也搜索过,目前没有例子,你可以看看现有的例子: https//github.com/zeromq/netmq/tree/master/src/Samples

Also it should be simple to port a czmq majordomo to netmq. 将czmq majordomo移植到netmq也应该很简单。

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

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