NServiceBus:进程发布到多个队列的要求

发布于 2024-11-29 11:46:12 字数 297 浏览 6 评论 0原文

我们有一个进程已经使用 NServiceBus 向系统中运行的其他进程发布消息。我想向此进程添加附加功能,这将要求它将消息发布到其他进程,但我希望能够使用新类型的消息写入另一个队列。最好,我不想将消息混合在同一队列上,因为它们具有不同的优先级。我所看到的一切都表明 NServiceBus 仅支持每个进程一个队列。这是正确的吗?

如果是这样,那么有人可以建议一个好的解决方法吗?我唯一能想到的是将新队列放置在单独的“NServiceBus Hub”进程中,然后使用 WCF 集成功能将新消息进程间从我的进程中继到集线器,以便插入到新队列中。

谢谢。

We have a process that uses NServiceBus already to publish messages to other processes running in our system. I want to add additional functionality to this process which will require it to publish messages to other processes, but I want to be able to write to another queue with the new type of message. Preferably, I don’t want to mix messages together on the same queue as they have different priorities. All that I have seen indicates that NServiceBus only supports one queue per process. Is this correct?

If this is so, then can anyone suggest a good workaround? The only one I can think of is to house the new queue in a separate “NServiceBus Hub” process, then use the WCF integration feature to relay the new message inter-process from my process to the hub for insertion on the new queue.

Thanks.

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

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

发布评论

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

评论(1

哽咽笑 2024-12-06 11:46:12

您对在单个队列上混合高优先级和低优先级消息的担忧是有道理的。

这需要在发送方和接收方双方解决。

发送方不会在本地写入其自己的单个队列。相反,当发送者向接收者发送消息时,发送者会写入特定于该接收者的临时本地队列。

因此,您有两个潜在的问题:

  1. 接收方处理来自同一队列的高优先级和低优先级消息。
  2. 发送方同时发送高优先级和低优先级消息。

如果是这种情况,您可以执行以下一项或两项操作:

  1. 将接收方服务分为两项服务,一项用于高优先级处理,一项用于低优先级处理。
  2. 您可能还希望将高优先级处理分离到它自己的 NServiceBus 发布者服务中。

这将按优先级为您提供多个端点,并且它们之间有清晰的分离。

Your concern about mixing high and low priority messages on a single queue is valid.

This needs to be addressed at both the sender and receiver side.

The sender does not write locally to it's own single queue. Rather when it sends a message to a recipient the sender writes to a temporary local queue specific to that recipient.

So you have two potential problems:

  1. The receiver processing high and low priority messages from the same queue.
  2. The sender is sending both high and low priority messages.

If this is the case you can do one or both of:

  1. Separate the receiver service into two services, one for high priority processing and one for low priority.
  2. You may also want to separate the high priority processing into it's own NServiceBus publisher service.

This will give you the multiple endpoints by priority with a clean separation between them.

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