佐贺数据nservicebus并发访问 [英] nservicebus concurrent access to saga data

查看:141
本文介绍了佐贺数据nservicebus并发访问的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用NServiceBus为企业服务总线,在解决方案中我发展我有所有客户端应用程序接收多达10K消息的业务流程服务。我想提高性能架构,从而提升解决方案提供。

i use NServiceBus as enterprise Service Bus, in the solution i'm developing i have an orchestration service which receives up to 10k messages from all client applications. I would like to improve the architecture performance and consequently enhance the solution provided.

我使用的是佐贺数据类,我想与大家分享所有工作线程之间的访问它(到现在我仅有一个线程,但我想设置至少到10),当多个线程试图访问同一传奇istance会发生什么?是否已经NSB提供这样的并发功能?我一定要实现它在我自己的?如果后者的任何提示?

I use a Saga Data class and i would like to share the access to it between all worker threads(up to now i set just to one thread but i want to set at least to 10), what happens when multiple threads try to access the same saga istance? Does NSB already provide such a concurrency feature? Do i have to implement it on my own? if latter any hints?

在此先感谢

推荐答案

如果我正确理解你的要求,如果你有多个线程同时访问同一个传奇的实例会发生什么。 NServiceBus是使用底层存储,以确保只有一个线程可以创建/在同一时间更新一个给定的传奇实例。其他人会回滚和重试NServiceBus的支持将确保该消息被重试,从而解决竞争条件适合你。你可以在这里阅读更多:

If I understand you correctly your asking what will happen if you have more than one thread accessing the same saga instance concurrently. NServiceBus is using the underlying storage to make sure that only one thread can create/update a given saga instance at the same time. Others will rollback and the NServiceBus support for retries will make sure that the message is retried and thereby solve the race condition for you. You can read more here:

http://andreasohlund.net/2012/09/19/nservicebus-sagas-and-concurrency/

这篇关于佐贺数据nservicebus并发访问的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆