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


C# BusConfiguration.DisableFeature方法代码示例

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


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

示例1: 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

示例2: Main

        static void Main()
        {
            var builder = new ContainerBuilder();

            builder.RegisterType<Program>();

            var container = builder.Build();

            var configuration = new BusConfiguration();

            configuration.UseContainer<AutofacBuilder>(c => c.ExistingLifetimeScope(container));

            configuration.UseTransport<AzureStorageQueueTransport>()
                .ConnectionString("UseDevelopmentStorage=true");
            configuration.UsePersistence<AzureStoragePersistence>();
            configuration.UseSerialization<JsonSerializer>();

            configuration.DisableFeature<Sagas>();
            configuration.DisableFeature<TimeoutManager>();

            configuration.Conventions().DefiningCommandsAs(t => t.Namespace != null && t.Namespace.StartsWith("NServiceBusDemo.Messages.Commands"));
            configuration.Conventions().DefiningEventsAs(t => t.Namespace != null && t.Namespace.StartsWith("NServiceBusDemo.Messages.Events"));
            configuration.Conventions().DefiningMessagesAs(t => t.Namespace != null && t.Namespace.StartsWith("NServiceBusDemo.Messages.Responses"));

            Bus.Create(configuration).Start();

            using (var scope = container.BeginLifetimeScope())
            {
                scope.Resolve<Program>().Run();
            }
        }
开发者ID:Rommel-Villa,项目名称:NSB_Spike,代码行数:31,代码来源:Program.cs

示例3: Main

    static void Main()
    {
        BusConfiguration busConfiguration = new BusConfiguration();

        busConfiguration.EndpointName("Samples.ASB.Polymorphic.Subscriber");
        busConfiguration.ScaleOut().UseSingleBrokerQueue();
        busConfiguration.UseTransport<AzureServiceBusTransport>()
            .ConnectionString(Environment.GetEnvironmentVariable("AzureServiceBus.ConnectionString"));

        #region DisableAutoSubscripton

        busConfiguration.DisableFeature<AutoSubscribe>();

        #endregion


        busConfiguration.UseSerialization<JsonSerializer>();
        busConfiguration.EnableInstallers();
        busConfiguration.UsePersistence<InMemoryPersistence>();
        busConfiguration.DisableFeature<SecondLevelRetries>();


        using (IBus bus = Bus.Create(busConfiguration).Start())
        {
            #region ControledSubscriptions

            bus.Subscribe<BaseEvent>();

            #endregion

            Console.WriteLine("Subscriber is ready to receive events");
            Console.WriteLine("Press any key to exit");
            Console.ReadKey();
        }
    }
开发者ID:cdnico,项目名称:docs.particular.net,代码行数:35,代码来源:Program.cs

示例4: Customize

        public void Customize(BusConfiguration config)
        {
            config.DisableFeature<TimeoutManager>();
            config.DisableFeature<SecondLevelRetries>();
            config.DisableFeature<Sagas>();

        }
开发者ID:gaurav0106,项目名称:NServiceBus.Azure.Samples,代码行数:7,代码来源:EndpointConfig.cs

示例5: Host

        public static void Host(TextWriter log, CancellationToken cancellationToken)
        {
            var defaultFactory = LogManager.Use<DefaultFactory>();
            defaultFactory.Level(LogLevel.Info);

            var configuration = new BusConfiguration();
            configuration.EndpointName("APIComparer.Backend");
            configuration.DisableFeature<SecondLevelRetries>();
            configuration.DisableFeature<Sagas>();
            configuration.DisableFeature<TimeoutManager>();


            configuration.UseTransport<AzureStorageQueueTransport>()
                .ConnectionString(AzureEnvironment.GetConnectionString);
            configuration.UsePersistence<AzureStoragePersistence>();
            configuration.EnableInstallers();

            using (Bus.Create(configuration).Start())
            {
                log.WriteLine("APIComparer.Backend - bus started");

                cancellationToken.WaitHandle.WaitOne();
            }

            log.WriteLine("APIComparer.Backend cancelled at " + DateTimeOffset.UtcNow);
        }
开发者ID:AntoineGa,项目名称:APIComparer,代码行数:26,代码来源:Functions.cs

示例6: Application_Start

        protected void Application_Start(object sender, EventArgs e)
        {
            var configuration = new BusConfiguration();
            configuration.DisableFeature<CriticalTimeMonitoring>();
            configuration.DisableFeature<SLAMonitoring>();
            configuration.LoadMessageHandlers<First<UserAuthenticatedHandler>>();
            configuration.UsePersistence<InMemoryPersistence>();

            Bus = NServiceBus.Bus.Create(configuration).Start();
        }
开发者ID:ramonsmits,项目名称:supportcode,代码行数:10,代码来源:Global.asax.cs

示例7: 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

示例8: AsyncMain

    static async Task AsyncMain()
    {
        LogManager.Use<DefaultFactory>().Level(LogLevel.Info);
        BusConfiguration busConfiguration = new BusConfiguration();
        busConfiguration.EndpointName("Samples.PubSub.Subscriber2");
        busConfiguration.UseSerialization<JsonSerializer>();
        busConfiguration.DisableFeature<AutoSubscribe>();
        busConfiguration.UsePersistence<InMemoryPersistence>();
        busConfiguration.SendFailedMessagesTo("error");
        busConfiguration.EnableInstallers();

        IEndpointInstance endpoint = await Endpoint.Start(busConfiguration);
        try
        {
            IBusSession busSession = endpoint.CreateBusSession();
            await busSession.Subscribe<IMyEvent>();
            Console.WriteLine("Press any key to exit");
            Console.ReadKey();
            await busSession.Unsubscribe<IMyEvent>();
        }
        finally
        {
            await endpoint.Stop();
        }
    }
开发者ID:cdnico,项目名称:docs.particular.net,代码行数:25,代码来源:Program.cs

示例9: Main

    static void Main()
    {
        Console.Title = "Samples.SqlServer.StoreAndForwardReceiver";
        BusConfiguration busConfiguration = new BusConfiguration();
        busConfiguration.EndpointName("Samples.SqlServer.StoreAndForwardReceiver");

        #region ReceiverConfiguration

        busConfiguration.UseTransport<SqlServerTransport>()
            .UseSpecificConnectionInformation(
                EndpointConnectionInfo.For("Samples.SqlServer.StoreAndForwardSender")
                    .UseConnectionString(@"Data Source=.\SQLEXPRESS;Initial Catalog=sender;Integrated Security=True"));

        busConfiguration.UsePersistence<NHibernatePersistence>();

        #endregion

        busConfiguration.DisableFeature<SecondLevelRetries>();

        using (Bus.Create(busConfiguration).Start())
        {
            Console.WriteLine("Press any key to exit");
            Console.ReadKey();
        }
    }
开发者ID:odelljl,项目名称:docs.particular.net,代码行数:25,代码来源:Program.cs

示例10: AsyncMain

    static async Task AsyncMain()
    {
        LogManager.Use<DefaultFactory>()
            .Level(LogLevel.Warn);

        #region DisableSLR
        BusConfiguration busConfiguration = new BusConfiguration();
        busConfiguration.EndpointName("Samples.ErrorHandling.WithoutSLR");
        busConfiguration.DisableFeature<SecondLevelRetries>();
        #endregion
        busConfiguration.UseSerialization<JsonSerializer>();
        busConfiguration.UsePersistence<InMemoryPersistence>();
        busConfiguration.EnableInstallers();
        busConfiguration.SendFailedMessagesTo("error");

        using (IBus bus = await Bus.Create(busConfiguration).StartAsync())
        {
            Console.WriteLine("Press enter to send a message that will throw an exception.");
            Console.WriteLine("Press any key to exit");

            while (true)
            {
                ConsoleKeyInfo key = Console.ReadKey();
                if (key.Key != ConsoleKey.Enter)
                {
                    return;
                }
                MyMessage m = new MyMessage
                {
                    Id = Guid.NewGuid()
                };
                await bus.SendLocalAsync(m);
            }
        }
    }
开发者ID:RichieYang,项目名称:docs.particular.net,代码行数:35,代码来源:Program.cs

示例11: Customize

 public void Customize(BusConfiguration configuration)
 {
     configuration.UsePersistence<DatabaseRoutingInMemoryPersistence>();
     configuration.DisableFeature<AutoSubscribe>();
     configuration.Pipeline.Register<DatabaseRouting.DatabaseRoutingStepInPipeline>();
     configuration.CustomConfigurationSource(new DatabaseRoutingConfiguration());
 }
开发者ID:ramonsmits,项目名称:NServiceBus-RoutingInDataBase,代码行数:7,代码来源:EndpointConfig.cs

示例12: Main

    static void Main()
    {
        LogManager.Use<DefaultFactory>()
            .Level(LogLevel.Warn);

        BusConfiguration busConfiguration = new BusConfiguration();
        busConfiguration.EndpointName("Samples.ErrorHandling.WithoutSLR");
        busConfiguration.UseSerialization<JsonSerializer>();
        busConfiguration.UsePersistence<InMemoryPersistence>();
        busConfiguration.DisableFeature<SecondLevelRetries>();
        busConfiguration.EnableInstallers();

        using (IBus bus = Bus.Create(busConfiguration).Start())
        {
            Console.WriteLine("Press any key to send a message that will throw an exception.");
            Console.WriteLine("To exit, press Ctrl + C");

            while (true)
            {
                Console.ReadLine();
                MyMessage m = new MyMessage
                              {
                                  Id = Guid.NewGuid()
                              };
                bus.SendLocal(m);
            }
        }
    }
开发者ID:ryanrdl,项目名称:docs.particular.net,代码行数:28,代码来源:Program.cs

示例13: DisableFeature

 void DisableFeature()
 {
     #region DisableBestPracticeEnforcementPerEndpoint
     BusConfiguration busConfiguration = new BusConfiguration();
     busConfiguration.DisableFeature<BestPracticeEnforcement>();
     #endregion
 }
开发者ID:ryanrdl,项目名称:docs.particular.net,代码行数:7,代码来源:BestPracticesConfiguration.cs

示例14: DisableAutoSubscribe

        void DisableAutoSubscribe(BusConfiguration busConfiguration)
        {
            #region DisableAutoSubscribe

            busConfiguration.DisableFeature<AutoSubscribe>();

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

示例15: DisableWithCode

        DisableWithCode(BusConfiguration busConfiguration)
        {
            #region DisableSlrWithCode

            busConfiguration.DisableFeature<SecondLevelRetries>();

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


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