Exemple #1
0
        void ValidateConfiguration()
        {
            if (!(containerAdapter.HasImplementationOf(typeof(ISendMessages)) ||
                  containerAdapter.HasImplementationOf(typeof(IReceiveMessages))))
            {
                throw new ConfigurationException
                          (@"
You need to configure Rebus to be able to at least either SEND or RECEIVE messages. Otherwise
it wouldn't be that useful, would it?

If, for some reason, you really really WANT to circumvent this rule, please feel free to get
the bus by new'ing it up yourself - then you can do whatever you feel like.

This configuration API, however, will not let you create an unusable bus. You can configure
the transport in one easy operation like so:

    var bus = Configure.With(someContainerAdapter)
                .Transport(s => s.UseMsmq(""some_input_queue_name""))
                (....)
                .CreateBus()

thus configuring the ability to send AND receive messages at the same time, using MSMQ for
both.");
            }
        }