简体   繁体   English

Nservice总线中Async handler的优势

[英]Advantage of Async handler in Nservice bus

I am currently upgrading Nservicebus from version 4 to version 7. The application is written in c#.我目前正在将 Nservicebus 从版本 4 升级到版本 7。该应用程序是用 c# 编写的。 It seems that we can convert the existing synch handler to async handler in the new version of Nservicebus.看来我们可以在新版本的Nservicebus 中将现有的同步处理程序转换为异步处理程序。 what will be the advantage of changes to asynch.更改异步有什么好处。 Can I handle multiple request at same time?.我可以同时处理多个请求吗? There are lot of handlers in one subscriber project.一个订阅者项目中有很多处理程序。 Some handler will perform Database update and some will perform database update and service call.一些处理程序将执行数据库更新,一些处理程序将执行数据库更新和服务调用。 Currently handler having lot of sync methods that will perform these operations.当前处理程序有很多同步方法来执行这些操作。 I am afraid whether I will face any issue if I move to production with these code如果我使用这些代码进行生产,我担心是否会遇到任何问题

Version 6 of NServiceBus moved to the "full async" API. NServiceBus 的第 6 版移至“完全异步”API。 In other words no matter what your logic inside the handlers is you will need to convert your code to align with the new API.换句话说,无论处理程序中的逻辑是什么,您都需要转换代码以与新 API 保持一致。

I would encourage you to read version 5 to 6 upgrade guide for a detailed explanation of the changes made and instructions on how to migrate your code.我鼓励您阅读第 5 版到第 6版升级指南,以获取对所做更改的详细说明以及有关如何迁移代码的说明。

Migrating from version 4 to 7 includes upgrading by more than one version.从版本 4 迁移到版本 7 包括升级多个版本。 In such cases, it's advised to migrate in a stepwise manner one version at a time.在这种情况下,建议逐步迁移一个版本。

You can find upgrades for each pair of versions in the documentation site I've linked.您可以在我链接的文档站点中找到每对版本的升级。

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

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