为什么将 NServiceBus 与 AzureServiceBus 一起使用?

You*_*onk 1 architecture nservicebus azureservicebus microservices

AzureServiceBus 和 NServiceBus 对我来说都是新的,我正在探索将 NServiceBus 用于微服务架构。

我知道 NServiceBus 可以使用不同的传输方式,如 Learning、SQLServer、MSMQ、AzureServiceBus 等。我还使用上述传输方式创建了 POC。

我想了解的是,当 AzureServiceBus 可以用作企业服务总线时,将 NServiceBus 与它一起使用有什么好处?

换句话说,为什么我要使用 AzureServiceBus 作为 NServiceBus 中的传输?不只使用 AzureServiceBus 有什么好的理由吗?

Sea*_*man 5

为什么要使用 AzureServiceBus 作为 NServiceBus 中的传输?

Azure 服务总线不是一个简单的依赖项。有些事情,例如重试和间歇性错误、连接处理、序列化和反序列化、消息大小限制、事务管理等,您可能不想自己做或在代码中包含这些内容。这就是 NServiceBus 发挥作用的地方。它还带来了一些您在早期可能不一定会考虑的额外好处。例如操作工具(监控、手动重试等)。它提供的编程模型为您提供了许多概念的抽象,允许您在需要时最终转移到另一个消息传递服务。

From a business perspective, developers can focus on the business problem, rather than spending time first on building middleware to handle Azure Service Bus, and later integrating middleware support into budgets allocated for business problems/products. The cost of NServiceBus compared to the cost of the development time, combined with the on-going cost of Service Bus related code maintenance and bug fixes, is minuscule. In the same way that companies, when building business software, don't build their own operating systems, our customers choose to focus on their core business, leaving messaging infrastructure to NServiceBus.

Disclaimer: I'm involved in developing NServiceBus and a contributor to the Azure Service Bus transport.