kfuglsang
kfuglsang

Reputation: 2505

NServiceBus without input queue

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.

Upvotes: 2

Views: 691

Answers (2)

Andreas Öhlund
Andreas Öhlund

Reputation: 5273

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

Upvotes: 1

Adam Fyles
Adam Fyles

Reputation: 6050

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

Upvotes: 0

Related Questions