Esempio n. 1
0
        static void Main(string[] args)
        {
            var          handler        = new BuiltinHandlerActivator();
            var          rabbitMqConfig = new RabbitMqConfig();
            const string inputQueue     = "dotnetQueue";

            AddMessageHandler(handler);
            var bus = ConfigureWithRabbitMqTransport(handler, rabbitMqConfig, inputQueue);

            Thread.Sleep(TimeSpan.FromMinutes(60));
            Environment.Exit(1);
        }
Esempio n. 2
0
 private static IBus ConfigureWithRabbitMqTransport(
     IHandlerActivator handler,
     RabbitMqConfig rabbitMqConfig,
     string inputQueue)
 {
     return(Configure.With(handler)
            .Options(optionsConfigure =>
     {
         // Add standard header converter extension.
         // The extension will convert incoming messages with standard headers to rebus headers,
         // and convert rebus headers to standard headers on outgoing messages.
         optionsConfigure.AddStandardHeaderConverter();
     })
            .Transport(t =>
                       t.UseRabbitMq(rabbitMqConfig.ConnectionString, inputQueue)
                       .EnablePublisherConfirms())
            .Start());
 }