IISRESET后如何续订?

发布于 2024-10-10 02:28:42 字数 297 浏览 0 评论 0原文

这是我的场景:

  • 具有自托管总线(发布者)
  • 和 NServiceBus.Host.exe(订阅者)的 Windows 服务的

Web 应用程序想象一下,触发 IISRESET(不用介意为什么我必须这样做),使总线重新启动初始化并丢失已有的订阅。我正在使用 MsmqSubscriptionStorage ,发布者(Web 应用程序)实现 IAuthorizeSubscriptions 接口。

如何续订订阅并调用 AuthorizeSubscribe()?这可能吗?您对这个场景有什么建议?

This is my scenario:

  • Web application with a self-hosted bus (publisher)
  • Windows service with NServiceBus.Host.exe (subscriber)

Imagine that trigger an IISRESET (never mind on the why I have to do that) that makes the bus re-initialize and lose the subscriptions that already had. I'm using MsmqSubscriptionStorage and the publisher (web app) implements the IAuthorizeSubscriptions interface.

How can I renew the subscriptions and also call the AuthorizeSubscribe()? Is that possible? What's your suggestion to this scenario?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

终弃我 2024-10-17 02:28:42

如果 NServiceBus 正确使用 MsmqSubscriptionStorage,则在 iisreset 后,总线应初始化并从配置的存储队列加载现有订阅。该队列名称可以通过配置设置,或者如果省略,则应默认为基于程序集加“_storage”的名称。但是,由于从未在 Web 应用程序中使用过此功能,因此我不知道在这种情况下会发生什么,因为没有实现 IConfigureThisEndpoint 的类。

也就是说,尝试从 Web 应用程序发布事件是一件非常棘手的事情,它是 通常建议您避免这样做

If NServiceBus is properly using MsmqSubscriptionStorage, then after iisreset, the bus should initialize and load the existing subscriptions from the configured storage queue. This queue name can either be set by configuration or, if omitted, should default to a name based on an assembly plus "_storage". However, having never used this from a web application, I don't know what that would be in that scenario, since there is no class that implements IConfigureThisEndpoint.

That said, trying to publish an event from a web application is a very icky business, and it's generally advised that you avoid just that.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文