多个 NServiceBus 发布者可以共享同一个 DBSubscriptionStorage 吗? [英] Can multiple NServiceBus publishers share the same DBSubscriptionStorage?

查看:62
本文介绍了多个 NServiceBus 发布者可以共享同一个 DBSubscriptionStorage 吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

查看发布-订阅 API 和配置页面,它会NServiceBus 用于跟踪订阅的数据库架构似乎只跟踪订阅者端点和消息类型.

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.

重点是 - 我完全理解并同意每个事件类型有一个发布者端点的概念 - 但这不可避免地导致多个发布者都在相同的应用程序范围内运行.也许在不同的组件或过程中运行,但这是一个有争议的问题;无论如何,这意味着所有或大多数发布者将共享相同的事务数据库.因此,必须为每个单独的发布者实际创建一个单独的 SQL 数据库 的可能性似乎有点荒谬;我们最终会拥有数百个单表订阅数据库.

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.

DBSubscriptionStorage 是否跟踪足够的信息来识别发布者,以便多个发布者都可以指向同一个数据库?或者,如果没有,是否有一些配置更改或 hack 可以用来完成相同的最终结果?

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?

推荐答案

你绝对可以使用同一个数据库中的同一个表来存储多个发布者的订阅.由于每个发布者负责其特定的消息类型,因此不会有逻辑重叠.

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.

这篇关于多个 NServiceBus 发布者可以共享同一个 DBSubscriptionStorage 吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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