当 MSDTC 两端均不可用时,如何使用网关配置 nservicebus

发布于 2024-12-29 03:47:10 字数 1306 浏览 6 评论 0原文

我是 NServiceBus 的新手,尝试将消息传递引入 WCF/RPC 解决方案。

由于架构限制和开销(内存和 CPU 使用率已经很高),IT 运营将不允许 MSDTC。 (我也热衷于避免 2PC fwiw)。我还需要通过 http 发送消息,因此 NSB 桥看起来是一个很好的解决方案。

基于这些帖子(how-i-avoid-two -phase-commitextending-nservicebus-avoiding-two-phase-commits)在我看来好像可以在禁用 DTC 的情况下使用 NSB。 听起来 EventStore 确实设法以与我想要设置 NSB 相同的方式避免 2PC,但目前我只是想让 NSB 工作,而不是添加事件源。

问题:

  1. 是否有配置 NSB 以这种方式工作的示例?我很高兴添加额外的复杂性(具有本地消息状态存储的自定义消息处理程序)——如果没有 2PC,就没有其他选择。我已经知道这个示例(IdempotConsumer),但此存储库的测试项目不包含任何代码。如果有一个使用 nosql 存储的示例会更有帮助。
  2. 我是否需要更改 NSB 桥才能处理无 DTC 的情况?我猜不会——桥接事务仅针对本地队列,但消耗本地队列的进程显然需要进行编码以避免 2PC。正确的?
  3. 在不使用 MSDTC 的情况下使用 NSB 是否还有其他有用的资源/帖子?解决方案(how-i-avoid-two-phase -commit) 似乎不太复杂,但考虑到我刚刚开始使用 NSB,找到一个快速入门会很棒...
  4. 我本以为这将是一个常见的场景 - 但没有似乎有很多关于避免的文章MSDTC 同时仍然使用 NSB。当然还有其他人正在使用消息总线,但不允许使用 MSDTC...还有我错过的另一种明显的方法吗?

谢谢

I am new to NServiceBus, trying to introduce messaging into a WCF/RPC solution.

Because of architectural constraints and overhead (memory and cpu usage already high) IT Operations will not allow MSDTC. (I'm also keen to avoid 2PC fwiw). I also require messages over http so the NSB bridge looks like a great solution.

Based on these posts (how-i-avoid-two-phase-commit and extending-nservicebus-avoiding-two-phase-commits) it looks to me as though it's possible to use NSB with the DTC disabled.
It sounds like EventStore does manage to avoid 2PC in the same way that I want to setup NSB but at the moment I just want to get NSB to work rather than adding event sourcing into the mix.

Questions:

  1. Are there any examples of configuring NSB to work this way? I'm quite happy to add the extra complexity (custom message handler with local message state storage) - without 2PC there isn't really another option. I already know of this example (IdempotentConsumer) but the test projects for this repo contain no code. It would be even more helpful if there was an example using nosql storage.
  2. Will I need to alter the NSB bridge to deal with no DTC? I'm guessing no - bridge transactions are only against the local queue but the process that consumes the local queue will obviously need to coded to avoid 2PC. Correct?
  3. Are there any other useful resources/posts around using NSB without MSDTC? The solution (how-i-avoid-two-phase-commit) seems not too complex but given I'm just starting out with NSB it would be great to find a quickstart for this...
  4. I would have thought this would be a common scenario - but there doesn't seem to be much written about avoiding MSDTC while still using NSB. Surely there are others who are using a message bus but aren't allowed to use MSDTC... Is there another obvious way that I've missed?

thanks

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

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

发布评论

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

评论(1

初吻给了烟 2025-01-05 03:47:11

2)是的,你应该没问题。由于您自己执行重复数据删除操作,因此不需要网关为您执行此操作。只需将其配置为使用 InMemory 持久性就可以了。

2) Yes you should be fine. Since you're doing the deduplication your self you don't need the gateway to do it for you. Just configure it to use the InMemory persistence and you should be fine.

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