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


C# BusConfiguration.EnableFeature方法代码示例

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


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

示例1: Configure

        /// <summary>
        /// Gives implementations access to the <see cref="T:NServiceBus.BusConfiguration"/> instance at configuration time.
        /// </summary>
        protected override void Configure(BusConfiguration config)
        {
            config.EnableFeature<KafkaTransportFeature>();
            config.EnableFeature<TimeoutManagerBasedDeferral>();

            config.GetSettings().EnableFeatureByDefault<TimeoutManager>();
        }
开发者ID:colin-higgins,项目名称:NServiceBus.Kafka,代码行数:10,代码来源:KafkaTransport.cs

示例2: Configure

 /// <summary>
 /// Gives implementations access to the <see cref="T:NServiceBus.BusConfiguration"/> instance at configuration time.
 /// </summary>
 protected override void Configure(BusConfiguration config)
 {
     config.EnableFeature<SqlServerTransportFeature>();
     config.EnableFeature<MessageDrivenSubscriptions>();
     config.EnableFeature<TimeoutManagerBasedDeferral>();
     config.GetSettings().EnableFeatureByDefault<StorageDrivenPublishing>();
     config.GetSettings().EnableFeatureByDefault<TimeoutManager>();
 }
开发者ID:james-wu,项目名称:NServiceBus.SqlServer,代码行数:11,代码来源:SqlServerTransport.cs

示例3: Configure

        /// <summary>
        /// Gives implementations access to the <see cref="BusConfiguration"/> instance at configuration time.
        /// </summary>
        protected internal override void Configure(BusConfiguration config)
        {
            config.EnableFeature<MsmqTransportConfigurator>();
            config.EnableFeature<MessageDrivenSubscriptions>();
            config.EnableFeature<TimeoutManagerBasedDeferral>();

            config.Settings.EnableFeatureByDefault<StorageDrivenPublishing>();
            config.Settings.EnableFeatureByDefault<TimeoutManager>();
        }
开发者ID:ogdenmd,项目名称:NServiceBus,代码行数:12,代码来源:Msmq.cs

示例4: Configure

        /// <summary>
        /// Gives implementations access to the <see cref="T:NServiceBus.BusConfiguration"/> instance at configuration time.
        /// </summary>
        protected override void Configure(BusConfiguration config)
        {
            config.EnableFeature<RabbitMqTransportFeature>();
            config.EnableFeature<TimeoutManagerBasedDeferral>();

            config.GetSettings().EnableFeatureByDefault<TimeoutManager>();

            //enable the outbox unless the users hasn't disabled it
            if (config.GetSettings().GetOrDefault<bool>(typeof(Features.Outbox).FullName))
            {
                config.EnableOutbox();
            }
        }
开发者ID:MyDealerLot,项目名称:NServiceBus.RabbitMQ,代码行数:16,代码来源:RabbitMqTransport.cs

示例5: Configure

        /// <summary>
        /// Gives implementations access to the <see cref="BusConfiguration"/> instance at configuration time.
        /// </summary>
        protected internal override void Configure(BusConfiguration config)
        {
            // For MSMQ the endpoint differentiator is a no-op since you commonly scale out by running the same endpoint on a different machine.
            // if users want to run more than one instance on the same machine they need to set an explicit discriminator
            config.GetSettings()
                .SetDefault("EndpointInstanceDiscriminator", "");
               
            config.EnableFeature<MsmqTransportConfigurator>();
            config.EnableFeature<MessageDrivenSubscriptions>();
            config.EnableFeature<TimeoutManagerBasedDeferral>();

            config.Settings.EnableFeatureByDefault<StorageDrivenPublishing>();
            config.Settings.EnableFeatureByDefault<TimeoutManager>();
        }
开发者ID:xqfgbc,项目名称:NServiceBus,代码行数:17,代码来源:Msmq.cs

示例6: EndpointConfiguration

        void EndpointConfiguration(BusConfiguration busConfiguration)
        {
#region EnableDisableFeatures
            // enable delayed delivery feature since SLR relies on it
            busConfiguration.EnableFeature<DelayedDeliveryFeature>();

            // this is not required if the feature uses EnableByDefault()
            busConfiguration.EnableFeature<SecondLevelRetries>();

            // we can disable features we won't use
            busConfiguration.DisableFeature<Sagas>();

            IStartableBus bus = Bus.Create(busConfiguration);
#endregion
        }
开发者ID:odelljl,项目名称:docs.particular.net,代码行数:15,代码来源:FeatureConfiguration.cs

示例7: AsyncMain

    static async Task AsyncMain()
    {
        LogManager.Use<DefaultFactory>().Level(LogLevel.Error);
        #region Program
        Logger.WriteLine("Starting configuration");
        BusConfiguration busConfiguration = new BusConfiguration();
        busConfiguration.EndpointName("Samples.StartupShutdown");
        busConfiguration.EnableInstallers();
        busConfiguration.EnableFeature<MyFeature>();
        busConfiguration.UsePersistence<InMemoryPersistence>();
        busConfiguration.SendFailedMessagesTo("error");

        Logger.WriteLine("Calling Bus.Create");
        IEndpointInstance endpoint = await Endpoint.Start(busConfiguration);
        try
        {
            //simulate some bus activity
            Thread.Sleep(500);

            Logger.WriteLine("Bus is processing messages");
        }
        finally
        {
            Logger.WriteLine("Calling IEndpointInstance.Stop");
            await endpoint.Stop();
        }
        Logger.WriteLine("Finished");
        #endregion
        Console.WriteLine("Press any key to exit");
        Console.ReadKey();
    }
开发者ID:vanwyngardenk,项目名称:docs.particular.net,代码行数:31,代码来源:Program.cs

示例8: Main

    static void Main()
    {
        LogManager.Use<DefaultFactory>().Level(LogLevel.Error);
        #region Program
        Logger.WriteLine("Starting configuration");
        BusConfiguration busConfiguration = new BusConfiguration();
        busConfiguration.EndpointName("Samples.StartupShutdown");
        busConfiguration.EnableInstallers();
        busConfiguration.EnableFeature<MyFeature>();
        busConfiguration.UsePersistence<InMemoryPersistence>();

        Logger.WriteLine("Calling Bus.Create");
        using (IStartableBus bus = Bus.Create(busConfiguration))
        {
            Logger.WriteLine("Calling IStartableBus.Create");
            bus.Start();

            //simulate some bus activity
            Thread.Sleep(500);

            Logger.WriteLine("Bus is processing messages");
            Logger.WriteLine("Calling IStartableBus.Dispose");
        }
        Logger.WriteLine("Finished");
        #endregion
        Console.WriteLine("Press any key to exit");
        Console.ReadKey();
    }
开发者ID:eclaus,项目名称:docs.particular.net,代码行数:28,代码来源:Program.cs

示例9: EndpointConfiguration

        async Task EndpointConfiguration()
        {
#region EnableDisableFeatures
            var configuration = new BusConfiguration();
            
            // enable delayed delivery feature since SLR relies on it
            configuration.EnableFeature<DelayedDeliveryFeature>();

            // this is not required if the feature uses EnableByDefault()
            configuration.EnableFeature<SecondLevelRetries>();

            // we can disable features we won't use
            configuration.DisableFeature<Sagas>();

            var endpoint = await Endpoint.Create(configuration);
#endregion
        }
开发者ID:cdnico,项目名称:docs.particular.net,代码行数:17,代码来源:FeatureConfiguration.cs

示例10: Customize

	    public void Customize(BusConfiguration configuration)
	    {
	        configuration.UsePersistence<InMemoryPersistence>();

            configuration.UseTransport<AzureServiceBusTransport>();

            configuration.EnableFeature<MessageDrivenSubscriptions>();
	    }
开发者ID:SeanFeldman,项目名称:NServiceBus.MsmqAsbBridge,代码行数:8,代码来源:EndpointConfig.cs

示例11: Configure

		protected override void Configure(BusConfiguration config)
		{
			config.EnableFeature<SqsTransportFeature>();
			config.EnableFeature<MessageDrivenSubscriptions>();
		
            if (!config.GetSettings().UseSqsDeferral())
            {
                config.EnableFeature<TimeoutManagerBasedDeferral>();
                config.GetSettings().EnableFeatureByDefault<TimeoutManager>();
            }

            config.GetSettings().EnableFeatureByDefault<StorageDrivenPublishing>();
		
			//enable the outbox unless the users hasn't disabled it
			if (config.GetSettings().GetOrDefault<bool>(typeof(Features.Outbox).FullName))
			{
				config.EnableOutbox();
			}
		}
开发者ID:GCMGrosvenor,项目名称:NServiceBus.AmazonSQS-1,代码行数:19,代码来源:SqsTransport.cs

示例12: Configure

        /// <summary>
        /// Gives implementations access to the <see cref="T:NServiceBus.BusConfiguration"/> instance at configuration time.
        /// </summary>
        protected override void Configure(BusConfiguration config)
        {
            config.GetSettings().SetDefault("SelectedSerializer", new JsonSerializer());
            config.GetSettings().SetDefault("EndpointInstanceDiscriminator", QueueIndividualizer.Discriminator);

            // make sure the transaction stays open a little longer than the long poll.
            config.Transactions().DefaultTimeout(TimeSpan.FromSeconds(AzureServicebusDefaults.DefaultServerWaitTime * 1.1)).IsolationLevel(IsolationLevel.Serializable);

            config.EnableFeature<AzureServiceBusTransportConfiguration>();
        }
开发者ID:danielmarbach,项目名称:NServiceBus.AzureServiceBus,代码行数:13,代码来源:AzureServiceBusTransport.cs

示例13: GatewayConfig

    public GatewayConfig()
    {
        #region GatewayConfiguration-v5

        var configuration = new BusConfiguration();

        configuration.EnableFeature<Gateway>();

        #endregion

    }
开发者ID:fafachd,项目名称:docs.particular.net,代码行数:11,代码来源:GatewayConfig.cs

示例14: Customize

        public void Customize(BusConfiguration configuration)
        {
            configuration.EnableFeature<JsonSerialization>();
            configuration.EnableFeature<XmlSerialization>();
            configuration.UseTransport<RabbitMQTransport>();
            configuration.UsePersistence<NHibernatePersistence>();
            configuration.DisableFeature<TimeoutManager>();

            configuration.Conventions()
                .DefiningCommandsAs(
                    c => c.Namespace != null && c.Namespace.StartsWith("EventTracking.Domain.Messages.Commands"))
                .DefiningEventsAs(
                    c => c.Namespace != null && c.Namespace.StartsWith("EventTracking.Domain.Messages.Events"))
                .DefiningMessagesAs(
                    m =>
                        m.Namespace != null &&
                        m.Namespace.StartsWith("EventTracking.Domain.Messages.Messages"));

            var builder = new ContainerBuilder();
            builder.RegisterModule(new DenormalizedStorageModule());
            var container = builder.Build();
            configuration.UseContainer<AutofacBuilder>(c => c.ExistingLifetimeScope(container));
        }
开发者ID:rjonker1,项目名称:lightstone-data-platform,代码行数:23,代码来源:EndpointConfig.cs

示例15: Customize

        public void Customize(BusConfiguration configuration)
        {
            configuration.EndpointName(GetType().Namespace);
              configuration.UseTransport<MsmqTransport>();
              configuration.UsePersistence<InMemoryPersistence>();
              configuration.EnableInstallers();
              configuration.EnableFeature<Gateway>();
              configuration.UseSerialization<JsonSerializer>();

              configuration.Conventions()
                   .DefiningMessagesAs(t => t.Namespace != null && t.Namespace.EndsWith(".Messages"))
                   .DefiningCommandsAs(t => t.Namespace != null && t.Namespace.EndsWith(".Commands"))
                   .DefiningEventsAs(t => t.Namespace != null && t.Namespace.EndsWith(".Events"));
        }
开发者ID:rioka,项目名称:NsbServiceHostBasedGatewayWithSaga,代码行数:14,代码来源:EndpointConfig.cs


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