没有输入队列的 NServiceBus

发布于 2024-09-12 03:07:44 字数 177 浏览 2 评论 0原文

是否可以在没有任何输入队列的情况下在应用程序中使用 NServiceBus?

原因是,我有一个 ASP.NET MVC 应用程序,当发生某些情况(例如新用户注册)时,它会向其他应用程序发送消息。 Web 应用程序永远不会收到任何响应或其他消息,因此我不想让应用程序陷入困境。 msmq peeking 每秒都会抛出一个异常。

Is it possible to use NServiceBus in an application without having any input queues?

Reason is, I have an ASP.NET MVC application that sends messages to other applications when something happens (e.g. a new user registers). The web application never recieves any responses or other messages and therefore I would like not to bog the app. with the msmq peeking which throws an exception every second.

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

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

发布评论

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

评论(2

掌心的温暖 2024-09-19 03:07:44

这是受支持的,只需删除 msmstranport 配置部分,一切都应该没问题。这适用于不存在 app.config 的 2.0.1281.0 (net4) 版本的 NServiceBus 有关

using NServiceBus;

    namespace SendOnlyEndpoint.Custom
    {
        public class Program
        {
            static void Main(string[] args)
            {
                var bus = Configure.With()
                    .DefaultBuilder()
                    .XmlSerializer()
                    .MsmqTransport()
                    .UnicastBus()
                    .CreateBus()
                    .Start();

                bus.Send("SendOnlyDestination",new TestMessage());
            }
        }

        public class TestMessage : IMessage
        {
        }
    }

仅发送端点的更多信息 此处

That is supported, just remove the msmstranport config section and all should be fine. This works against 2.0.1281.0 (net4) version of NServiceBus with no app.config present

using NServiceBus;

    namespace SendOnlyEndpoint.Custom
    {
        public class Program
        {
            static void Main(string[] args)
            {
                var bus = Configure.With()
                    .DefaultBuilder()
                    .XmlSerializer()
                    .MsmqTransport()
                    .UnicastBus()
                    .CreateBus()
                    .Start();

                bus.Send("SendOnlyDestination",new TestMessage());
            }
        }

        public class TestMessage : IMessage
        {
        }
    }

More info on send only endpoints here

终止放荡 2024-09-19 03:07:44

我会尝试不配置输入队列。 Bus.Send 将使用内部出站队列来发送消息。

I would try not configuring an input queue. Bus.Send will use an internal outbound queue to send messages.

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