开发者

NServiceBus without input queue

开发者 https://www.devze.com 2023-01-09 03:30 出处:网络
Is it possible to use NServiceBus in an application without having any input queues? Reason is, I have an ASP.NET MVC application that se开发者_C百科nds messages to other applications when something

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

Reason is, I have an ASP.NET MVC application that se开发者_C百科nds 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.


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


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

0

精彩评论

暂无评论...
验证码 换一张
取 消