protected void Application_Start()
        {
            Configure.ScaleOut(s => s.UseSingleBrokerQueue());

            bus = Configure.With()
                  .DefaultBuilder()
                  .Log4Net(new DebugAppender {
                Threshold = Level.Warn
            })
                  .UseTransport <RabbitMQ>()
                  .PurgeOnStartup(true)
                  .UnicastBus()
                  .RunHandlersUnderIncomingPrincipal(false)
                  .RijndaelEncryptionService()
                  .CreateBus()
                  .Start(() => Configure.Instance.ForInstallationOn <NServiceBus.Installation.Environments.Windows>()
                         .Install());

            AreaRegistration.RegisterAllAreas();
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            RouteConfig.RegisterRoutes(RouteTable.Routes);
        }
        protected void Application_Start()
        {
            var config = new BusConfiguration();

            config.Conventions()
            .DefiningCommandsAs(t => t.Namespace != null && t.Namespace.StartsWith("VideoStore") && t.Namespace.EndsWith("Commands"))
            .DefiningEventsAs(t => t.Namespace != null && t.Namespace.StartsWith("VideoStore") && t.Namespace.EndsWith("Events"))
            .DefiningMessagesAs(t => t.Namespace != null && t.Namespace.StartsWith("VideoStore") && t.Namespace.EndsWith("RequestResponse"))
            .DefiningEncryptedPropertiesAs(p => p.Name.StartsWith("Encrypted"));
            config.UseTransport <AzureStorageQueueTransport>();
            config.UsePersistence <AzureStoragePersistence>();
            config.PurgeOnStartup(true);
            config.RijndaelEncryptionService();
            config.EnableInstallers();


            startableBus = NServiceBus.Bus.Create(config);
            bus          = startableBus.Start();

            AreaRegistration.RegisterAllAreas();
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            RouteConfig.RegisterRoutes(RouteTable.Routes);
        }