nservicebus concurrent access to saga data

懵懂的女人 提交于 2019-12-05 19:16:20

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/

stephenl

Its unlikely that you would have multiple sagas sharing the same instance data, its just not how they are designed to work. A saga is an instance of a long running process. The saga data class is just a construct that allows you to store information about that instance that helps manage its state over its lifetime. If you want to improve performance I would recommend you look at distributing your worker endpoints (http://docs.particular.net/samples/scaleout/).

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!