Can multiple NServiceBus publishers share the same DBSubscriptionStorage?

我是研究僧i 提交于 2020-01-17 02:55:10

问题


Looking at the Publish-Subscribe API and Configuration page, it would seem that the database schema used by NServiceBus to track subscriptions only tracks the Subscriber Endpoint and Message Type.

I had hoped that maybe I could change the name of the table in order to use the same database for multiple publishers, but this thread seems to indicate that you can't.

The point is - I fully understand and agree with the notion of having a single publisher endpoint per event type - but that inevitably leads to having multiple publishers all operating out of the same application scope. Perhaps operating in different assemblies or processes but that is a moot point; regardless, it means that all or most publishers will share the same transactional database. So the possibility of having to actually create a separate SQL database for every individual publisher seems slightly ridiculous; we'd end up with hundreds of single-table subscription databases sitting around.

Does the DBSubscriptionStorage track enough information to identify the publisher as well, such that multiple publishers can all be pointed to the same database? Or if not, is there some configuration change or hack that I could use to accomplish the same end result?

Or am I actually going to need a separate database for every publisher - and by extension, every published message type?


回答1:


You absolutely can use the same table in the same database to store the subscriptions of multiple publishers. Since each publisher is responsible for its specific message types, there will be no logical overlap.



来源:https://stackoverflow.com/questions/5626155/can-multiple-nservicebus-publishers-share-the-same-dbsubscriptionstorage

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