【发布时间】:2019-05-12 18:36:57
【问题描述】:
我需要配置一个库EventBusServiceBus,但是搜索没有找到任何样本。请,我需要示例,如何使用 appSettings.json 配置与EventBusServiceBus 的连接
【问题讨论】:
-
如果您提供
EventBusServiceBus的参考或链接会有所帮助。
标签: c# asp.net azureservicebus event-bus
我需要配置一个库EventBusServiceBus,但是搜索没有找到任何样本。请,我需要示例,如何使用 appSettings.json 配置与EventBusServiceBus 的连接
【问题讨论】:
EventBusServiceBus 的参考或链接会有所帮助。
标签: c# asp.net azureservicebus event-bus
这是一本“.NET 微服务:容器化 .NET 应用程序架构”电子书,又名 eShopOnContainers,代码位于 GitHub。
EventBusServiceBus 应该收到IServiceBusPersisterConnection 的实现。这是使用DefaultServiceBusPersisterConnection 实现的,随后依赖于Azure 服务总线ServiceBusConnectionStringBuilder 在服务中创建和注册。一个示例是服务配置之一,例如 Ordering service here。
在appsettings.json 中,您必须定义以下设置:
AzureServiceBusEnabled 设置为 true
EventBusConnection 设置为 Azure 服务总线连接字符串【讨论】:
ServiceBusConnectionStringBuilder?
DefaultServiveBusPersisterConnection时需要提供SerciveBusConnectionStringBuilder并传入。你看过我指向here的代码吗?
TopicClient。连接字符串中的EntityPath 未定义,因此出现异常。此外,更改您的连接字符串的 SasKey,因为它现在已公开... 提示:将来,向相关代码添加链接/永久链接会有所帮助。干杯!
使用 eShopOnContainers 应用程序时,服务总线未在 GIT 存储库中正确实现。
您的连接字符串中缺少 entityPath 参数。您必须首先在 Azure 服务总线中创建一个主题。在 Azure 服务总线中设置你的主题的 entityPath= 名称。在 Azure 服务总线中,还为此主题创建订阅。您需要在 appsettings.json 文件中进行配置。将 appsettings 文件中的 subscriptionClientName 的值设置为刚刚创建的 Subscription 的名称。
【讨论】: