我一直在对高性能可靠消息传递系统的破坏者模式进行一些研究,作为 NServiceBus 的狂热用户,我想知道这是否可以实现?或者也许已经有一个实现了......我只是想知道其他人对此的想法?
最佳答案
如果您指的是LMAX architecture和马丁·汤普森 Mechanical Sympathy那么答案是否定的,至少在不久的将来。原因是disruptor架构与NServiceBus的架构在根本层面上有所不同。引用干扰者的话 GitHub page :
This is not a specialist solution, it's not designed to work only for a financial application. The Disruptor is a general-purpose mechanism for solving a difficult problem in concurrent programming. It works in a different way to more conventional approaches, so you use it a little differently than you might be used to. For example, applying the pattern to your system is not as simple as replacing all your queues with the magic ring buffer.
因此,可以使用 NServiceBus 中存在的一些抽象,例如 IMessageHandler,并使用环形缓冲区作为底层传输,但也可能需要更改一些抽象。
总的来说,我认为这是一个非常值得解决的问题。
关于data-structures - Disruptor 模式和 NServiceBus,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14186252/