当前位置: 首页>>代码示例>>C#>>正文


C# BusConfiguration.PurgeOnStartup方法代码示例

本文整理汇总了C#中BusConfiguration.PurgeOnStartup方法的典型用法代码示例。如果您正苦于以下问题:C# BusConfiguration.PurgeOnStartup方法的具体用法?C# BusConfiguration.PurgeOnStartup怎么用?C# BusConfiguration.PurgeOnStartup使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在BusConfiguration的用法示例。


在下文中一共展示了BusConfiguration.PurgeOnStartup方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GetConfiguration

        public BusConfiguration GetConfiguration(RunDescriptor runDescriptor, EndpointConfiguration endpointConfiguration, IConfigurationSource configSource, Action<BusConfiguration> configurationBuilderCustomization)
        {
            var settings = runDescriptor.Settings;

            var types = GetTypesToUse(endpointConfiguration);

            var config = new BusConfiguration();
            config.EndpointName(endpointConfiguration.EndpointName);
            config.TypesToScan(types);
            config.CustomConfigurationSource(configSource);
            config.UsePersistence<InMemoryPersistence>();
            config.PurgeOnStartup(true);

            // Plugin a behavior that listens for subscription messages
            config.Pipeline.Register<SubscriptionBehavior.Registration>();
            config.RegisterComponents(c => c.ConfigureComponent<SubscriptionBehavior>(DependencyLifecycle.InstancePerCall));
            
            // Important: you need to make sure that the correct ScenarioContext class is available to your endpoints and tests
            config.RegisterComponents(r =>
            {
                r.RegisterSingleton(runDescriptor.ScenarioContext.GetType(), runDescriptor.ScenarioContext);
                r.RegisterSingleton(typeof(ScenarioContext), runDescriptor.ScenarioContext);
            });

            // Call extra custom action if provided
            if (configurationBuilderCustomization != null)
            {
                configurationBuilderCustomization(config);
            }

            return config;
        }
开发者ID:narnau,项目名称:NServiceBus.AcceptanceTesting,代码行数:32,代码来源:DefaultServer.cs

示例2: InitServiceBus

        private void InitServiceBus(BusConfiguration config, IContainer container)
        {
            // Configure Logging
            NServiceBus.Logging.LogManager.Use<Log4NetFactory>();

            // Configure container
            config.UseContainer<StructureMapBuilder>(c => c.ExistingContainer(container));

            // Xml serialization makes for easy to read messages.
            config.UseSerialization<JsonSerializer>();

            //Define conventions
            ConventionsBuilder conventions = config.Conventions();
            conventions.DefiningCommandsAs(MessageTypeConventions.EndsWith("Command"));
            conventions.DefiningEventsAs(MessageTypeConventions.EndsWith("Event"));
            conventions.DefiningMessagesAs(MessageTypeConventions.EndsWith("Message"));

            // Keep it simple by default
            config.DisableFeature<SecondLevelRetries>();
            config.DisableFeature<AutoSubscribe>();
            config.DisableFeature<TimeoutManager>();
            config.DisableFeature<DataBus>();

            // Configure for MSMQ
            config.UseTransport<MsmqTransport>();
            config.Transactions().Enable();
            config.PurgeOnStartup(false);

            // Configure Saga Persistence
            config.UsePersistence<InMemoryPersistence>();
        }
开发者ID:techvenky,项目名称:microservice-template,代码行数:31,代码来源:EndpointConfig.cs

示例3: Customize

        public void Customize(BusConfiguration busConfiguration)
        {
            busConfiguration.PurgeOnStartup(true);

            var endpointName = "memleaktest";
            busConfiguration.EndpointName(endpointName);
            busConfiguration.EnableInstallers();
            busConfiguration.UseSerialization<JsonSerializer>();
            busConfiguration.UsePersistence<InMemoryPersistence>();
        }
开发者ID:ramonsmits,项目名称:nsb-stress,代码行数:10,代码来源:EndpointConfig.cs

示例4: Simple

    public void Simple()
    {
        #region PurgeOnStartupV5

        var configuration = new BusConfiguration();

        configuration.PurgeOnStartup(true);

        #endregion
    }
开发者ID:fafachd,项目名称:docs.particular.net,代码行数:10,代码来源:PurgeOnStartup.cs

示例5: RegisterBus

        private void RegisterBus()
        {
            var busConfiguration = new BusConfiguration();
            busConfiguration.UseSerialization<JsonSerializer>();
            busConfiguration.UseTransport<MsmqTransport>();
            busConfiguration.Transactions().Disable();
            busConfiguration.PurgeOnStartup(false);

            LogManager.Use<NServiceBus.Log4Net.Log4NetFactory>();

            Bus = NServiceBus.Bus.CreateSendOnly(busConfiguration);
        }
开发者ID:Valem,项目名称:NES,代码行数:12,代码来源:Global.asax.cs

示例6: AsAClientEquivalent

        public AsAClientEquivalent()
        {
            #region AsAClientEquivalent

            BusConfiguration busConfiguration = new BusConfiguration();

            busConfiguration.PurgeOnStartup(true);
            busConfiguration.Transactions().Disable();
            busConfiguration.DisableFeature<SecondLevelRetries>();
            busConfiguration.DisableFeature<StorageDrivenPublishing>();
            busConfiguration.DisableFeature<TimeoutManager>();

            #endregion
        }
开发者ID:odelljl,项目名称:docs.particular.net,代码行数:14,代码来源:AsAClientEquivalent.cs

示例7: Application_Start

    protected void Application_Start()
    {
        BusConfiguration configuration = new BusConfiguration();
        configuration.EndpointName("Store.ECommerce");
        configuration.PurgeOnStartup(true);

        configuration.ApplyCommonConfiguration();

        Bus = NServiceBus.Bus.Create(configuration).Start();

        AreaRegistration.RegisterAllAreas();
        FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
        RouteConfig.RegisterRoutes(RouteTable.Routes);
    }
开发者ID:vanwyngardenk,项目名称:docs.particular.net,代码行数:14,代码来源:Global.asax.cs

示例8: Customize

        public void Customize(BusConfiguration busConfiguration)
        {
            var container = new Container(x => x.AddRegistry<StructureMapRegistry>());

            busConfiguration.UseContainer<StructureMapBuilder>(x => x.ExistingContainer(container));

            busConfiguration.PurgeOnStartup(false);
            busConfiguration.UseSerialization<JsonSerializer>();
            busConfiguration.EnableInstallers();
            busConfiguration.UsePersistence<InMemoryPersistence>();
            busConfiguration.EndpointName("Case16203");

            BasicConfigurator.Configure();
            LogManager.Use<Log4NetFactory>();
        }
开发者ID:BobAtParticular,项目名称:Case16203,代码行数:15,代码来源:EndpointConfig.cs

示例9: AsyncStart

        static async Task AsyncStart()
        {
            var busConfiguration = new BusConfiguration();
            busConfiguration.EndpointName("Store.ECommerce");
            busConfiguration.PurgeOnStartup(true);

            busConfiguration.ApplyCommonConfiguration();
            busConfiguration.SendFailedMessagesTo("error");

            Bus = await NServiceBus.Bus.Create(busConfiguration).StartAsync();

            AreaRegistration.RegisterAllAreas();
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            RouteConfig.RegisterRoutes(RouteTable.Routes);
        }
开发者ID:RichieYang,项目名称:docs.particular.net,代码行数:15,代码来源:Global.asax.cs

示例10: Main

 static void Main()
 {
     var busConfig = new BusConfiguration();
     busConfig.EndpointName("JilSerializer.Perf.Core");
     busConfig.UseSerialization<JsonSerializer>();
     busConfig.EnableInstallers();
     busConfig.PurgeOnStartup(true);
     busConfig.UsePersistence<InMemoryPersistence>();
     busConfig.UseTransport<MsmqTransport>().ConnectionString("deadLetter=false;journal=false");
     busConfig.DisableFeature<Audit>();
     using (var bus = Bus.Create(busConfig))
     {
         bus.Start();
         MessageSender.SendMessages(bus);
     }
 }
开发者ID:hmemcpy,项目名称:NServiceBus.Jil,代码行数:16,代码来源:Program.cs

示例11: Create

        public static IBus Create()
        {
            var config = new BusConfiguration();

            config.ScaleOut().UseSingleBrokerQueue();
            config.Transactions().EnableDistributedTransactions();
            config.UseTransport<SqlServerTransport>();
            config.UsePersistence<NHibernatePersistence, StorageType.Sagas>();
            config.UsePersistence<NHibernatePersistence, StorageType.Subscriptions>();
            config.UsePersistence<NHibernatePersistence, StorageType.Timeouts>();
            config.UsePersistence<NHibernatePersistence, StorageType.Outbox>();
            config.PurgeOnStartup(false);
            config.EnableInstallers();

            return Bus.Create(config);
        }
开发者ID:ZlobnyiSerg,项目名称:logus-integration,代码行数:16,代码来源:BusFactory.cs

示例12: Customize

 public void Customize(BusConfiguration configuration)
 {
     configuration.UseSerialization<Json>();
     configuration.EnableInstallers();
     configuration.UsePersistence<InMemoryPersistence>();
     configuration.UseTransport<MsmqTransport>();
     configuration.PurgeOnStartup(false);
     configuration.RegisterComponents(c =>
     {
         c.ConfigureComponent<AuthenticationService>(DependencyLifecycle.InstancePerUnitOfWork);
         c.ConfigureComponent<Repository>(DependencyLifecycle.InstancePerUnitOfWork);
         c.ConfigureComponent<ValidationService>(DependencyLifecycle.SingleInstance);
         c.ConfigureComponent<MutateIncomingTransportMessages>(DependencyLifecycle.InstancePerCall);
         c.ConfigureComponent<ValidateIncomingMessages>(DependencyLifecycle.InstancePerCall);
         c.ConfigureComponent<DataRepository>(DependencyLifecycle.InstancePerUnitOfWork);
     });
 }
开发者ID:Valem,项目名称:NES,代码行数:17,代码来源:EndpointConfig.cs

示例13: Init

        public static void Init()
        {
            if (Bus != null)
                return;

            lock (padlock)
            {
                if (Bus != null)
                    return;

                var cfg = new BusConfiguration();

                cfg.UseTransport<MsmqTransport>();
                cfg.UsePersistence<InMemoryPersistence>();
                cfg.PurgeOnStartup(true);
                cfg.EnableInstallers();

                Bus = NServiceBus.Bus.CreateSendOnly(cfg);
            }
        }
开发者ID:mgmccarthy,项目名称:NSBTransactionalBoundariesWithIntegrations,代码行数:20,代码来源:ServiceBus.cs

示例14: Application_Start

        protected void Application_Start()
        {
            var configuration = new BusConfiguration();

            UnobtrusiveMessageConventions.Init(configuration.Conventions());

            configuration.UseTransport<RabbitMQTransport>();

            configuration.UsePersistence<InMemoryPersistence>();

            configuration.PurgeOnStartup(true);
            configuration.RijndaelEncryptionService();
            configuration.EnableInstallers();

            Bus = NServiceBus.Bus.Create(configuration).Start();

            AreaRegistration.RegisterAllAreas();
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            RouteConfig.RegisterRoutes(RouteTable.Routes);
        }
开发者ID:ghola,项目名称:NServiceBus.RabbitMQ.Samples,代码行数:20,代码来源:Global.asax.cs

示例15: Application_Start

        protected void Application_Start()
        {
            var config = new BusConfiguration();

            config.Conventions()
                    .DefiningCommandsAs(t => t.Namespace != null && (t.Namespace.StartsWith("Commands") || t.Namespace.Contains("Commands")))
                    .DefiningEventsAs(t => t.Namespace != null && (t.Namespace.EndsWith("Events") || t.Namespace.EndsWith("Notifications")));

            LogManager.Use<DefaultFactory>().Directory("c:/temp");

            config.UseTransport<AzureServiceBusTransport>();
            //config.UsePersistence<AzureStoragePersistence>();

            config.PurgeOnStartup(true);
            config.EnableInstallers();

            _bus = NServiceBus.Bus.CreateSendOnly(config);

            AreaRegistration.RegisterAllAreas();
            GlobalConfiguration.Configure(WebApiConfig.Register);
        }
开发者ID:jpv001,项目名称:DistributedMessagingExample,代码行数:21,代码来源:Global.asax.cs


注:本文中的BusConfiguration.PurgeOnStartup方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。