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


C# BusConfiguration.GetSettings方法代码示例

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


在下文中一共展示了BusConfiguration.GetSettings方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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<SqlServerTransportFeature>();
     config.EnableFeature<MessageDrivenSubscriptions>();
     config.EnableFeature<TimeoutManagerBasedDeferral>();
     config.GetSettings().EnableFeatureByDefault<StorageDrivenPublishing>();
     config.GetSettings().EnableFeatureByDefault<TimeoutManager>();
 }
开发者ID:james-wu,项目名称:NServiceBus.SqlServer,代码行数:11,代码来源:SqlServerTransport.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.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

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

示例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<KafkaTransportFeature>();
            config.EnableFeature<TimeoutManagerBasedDeferral>();

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

示例5: GetConfiguration

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

            LogManager.UseFactory(new ContextAppender(runDescriptor.ScenarioContext, endpointConfiguration.EndpointName));

            var types = GetTypesScopedByTestClass(endpointConfiguration);

            typesToInclude.AddRange(types);

            var builder = new BusConfiguration();

            builder.EndpointName(endpointConfiguration.EndpointName);
            builder.TypesToScan(typesToInclude);
            builder.CustomConfigurationSource(configSource);
            builder.EnableInstallers();
            builder.DefineTransport(settings, endpointConfiguration.BuilderType);
            builder.DefineTransactions(settings);
            builder.DefineBuilder(settings);
            builder.RegisterComponents(r =>
            {
                r.RegisterSingleton(runDescriptor.ScenarioContext.GetType(), runDescriptor.ScenarioContext);
                r.RegisterSingleton(typeof(ScenarioContext), runDescriptor.ScenarioContext);
            });


            SetSerializer(settings, builder);
            builder.DefinePersistence(settings);

            builder.GetSettings().SetDefault("ScaleOut.UseSingleBrokerQueue", true);
            configurationBuilderCustomization(builder);


            return builder;
        }
开发者ID:hmemcpy,项目名称:NServiceBus.Jil,代码行数:35,代码来源:DefaultServer.cs

示例6: IsEnabled

        void IsEnabled(BusConfiguration busConfiguration)
        {
            #region IsDistributorEnabled

            bool isDistributorEnabled = busConfiguration
                .GetSettings()
                .GetOrDefault<bool>(typeof(Distributor).FullName);

            #endregion

            #region IsWorkerEnabled

            bool isWorkerEnabled = busConfiguration
                .GetSettings()
                .GetOrDefault<bool>(typeof(WorkerNode).FullName);

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

示例7: CreateSendOnly

        /// <summary>
        /// Creates a bus instance to be used in send only mode
        /// </summary>
        /// <param name="configuration">The configuration to use</param>
        /// <returns></returns>
        public static ISendOnlyBus CreateSendOnly(BusConfiguration configuration)
        {
            configuration.GetSettings().Set("Endpoint.SendOnly", true);

            var config = configuration.BuildConfiguration();

            config.Initialize();

            return config.Builder.Build<ISendOnlyBus>();
        }
开发者ID:xqfgbc,项目名称:NServiceBus,代码行数:15,代码来源:Bus.cs

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

示例9: Start

        public void Start()
        {
            DynamicHostControllerConfig configSection = null;

            var o = new BusConfiguration();
            o.AssembliesToScan(GetType().Assembly);
            o.AzureConfigurationSource();
            o.RegisterComponents(Configurer =>
            {
                Configurer.ConfigureComponent<DynamicEndpointLoader>(DependencyLifecycle.SingleInstance);
                Configurer.ConfigureComponent<DynamicEndpointProvisioner>(DependencyLifecycle.SingleInstance);
                Configurer.ConfigureComponent<DynamicEndpointRunner>(DependencyLifecycle.SingleInstance);
                Configurer.ConfigureComponent<DynamicHostMonitor>(DependencyLifecycle.SingleInstance);

                configSection = o.GetSettings().GetConfigSection<DynamicHostControllerConfig>() ?? new DynamicHostControllerConfig();

                Configurer.ConfigureProperty<DynamicEndpointLoader>(t => t.ConnectionString, configSection.ConnectionString);
                Configurer.ConfigureProperty<DynamicEndpointLoader>(t => t.Container, configSection.Container);
                Configurer.ConfigureProperty<DynamicEndpointProvisioner>(t => t.LocalResource, configSection.LocalResource);
                Configurer.ConfigureProperty<DynamicEndpointProvisioner>(t => t.RecycleRoleOnError, configSection.RecycleRoleOnError);
                Configurer.ConfigureProperty<DynamicEndpointRunner>(t => t.RecycleRoleOnError, configSection.RecycleRoleOnError);
                Configurer.ConfigureProperty<DynamicEndpointRunner>(t => t.TimeToWaitUntilProcessIsKilled, configSection.TimeToWaitUntilProcessIsKilled);
                Configurer.ConfigureProperty<DynamicHostMonitor>(t => t.Interval, configSection.UpdateInterval);
            });

            o.UsePersistence<AzureStoragePersistence>();
            o.DiscardFailedMessagesInsteadOfSendingToErrorQueue();

            profileManager.ActivateProfileHandlers(o);
            specifier.Customize(o);

            var bus = (UnicastBus)Bus.CreateSendOnly(o);

            loader = bus.Builder.Build<DynamicEndpointLoader>();
            provisioner = bus.Builder.Build<DynamicEndpointProvisioner>();
            runner = bus.Builder.Build<DynamicEndpointRunner>();

            var endpointsToHost = loader.LoadEndpoints();
            if (endpointsToHost == null) return;

            runningServices = new List<EndpointToHost>(endpointsToHost);

            provisioner.Provision(runningServices);

            runner.Start(runningServices);

            if (!configSection.AutoUpdate) return;

            monitor = bus.Builder.Build<DynamicHostMonitor>();
            monitor.UpdatedEndpoints += UpdatedEndpoints;
            monitor.NewEndpoints += NewEndpoints;
            monitor.RemovedEndpoints += RemovedEndpoints;
            monitor.Monitor(runningServices);
            monitor.Start();
        }
开发者ID:mjhilton,项目名称:NServiceBus.Host.AzureCloudService,代码行数:55,代码来源:DynamicHostController.cs

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

示例11: Configure

    public void Configure(BusConfiguration config)
    {
        documentStore = new DocumentStore
        {
            Url = "http://localhost:8083",
            DefaultDatabase = Guid.NewGuid().ToString()
        };

        var settings = config.GetSettings();
        
        settings.Set(DefaultDocumentStoreKey, documentStore);

        var persistenceExtensions = config.UsePersistence<RavenDBPersistence>()
            .DoNotSetupDatabasePermissions()
            .SetDefaultDocumentStore(documentStore);

        settings.Set(DefaultPersistenceExtensionsKey, persistenceExtensions);

        Console.WriteLine("Created '{0}' database", documentStore.DefaultDatabase);
    }
开发者ID:hanin,项目名称:NServiceBus.RavenDB,代码行数:20,代码来源:Config.cs

示例12: Customize

 public void Customize(BusConfiguration configuration)
 {
     Configure.ForAllTypes<IWantQueueCreated>(configuration.GetSettings().GetAvailableTypes(),
         type => configuration.RegisterComponents(c => c.ConfigureComponent(type, DependencyLifecycle.InstancePerCall)));
 }
开发者ID:xqfgbc,项目名称:NServiceBus,代码行数:5,代码来源:QueuesCreator.cs

示例13: Main

    static void Main()
    {
        Console.Title = "Samples.MultiTenant.Receiver";

        var hibernateConfig = CreateBasicNHibernateConfig();
        var mapper = new ModelMapper();
        mapper.AddMapping<OrderMap>();
        hibernateConfig.AddMapping(mapper.CompileMappingForAllExplicitlyAddedEntities());

        var busConfiguration = new BusConfiguration();
        busConfiguration.UseSerialization<JsonSerializer>();
        busConfiguration.EndpointName("Samples.MultiTenant.Receiver");

        #region ReceiverConfiguration

        var persistence = busConfiguration.UsePersistence<NHibernatePersistence>();
        persistence.RegisterManagedSessionInTheContainer();
        persistence.UseConfiguration(hibernateConfig);
        persistence.UseSubscriptionStorageConfiguration(CreateBasicNHibernateConfig());
        persistence.UseTimeoutStorageConfiguration(CreateBasicNHibernateConfig());
        persistence.DisableSchemaUpdate();

        busConfiguration.EnableOutbox();

        var settingsHolder = busConfiguration.GetSettings();
        settingsHolder.Set("NHibernate.Timeouts.AutoUpdateSchema", true);
        settingsHolder.Set("NHibernate.Subscriptions.AutoUpdateSchema", true);

        #endregion

        #region ReplaceOpenSqlConnection

        busConfiguration.Pipeline.Replace("OpenSqlConnection", typeof(MultiTenantOpenSqlConnectionBehavior));

        #endregion

        #region RegisterPropagateTenantIdBehavior

        busConfiguration.Pipeline.Register<PropagateTenantIdBehavior.Registration>();

        #endregion

        busConfiguration.DisableFeature<SecondLevelRetries>();

        #region CreateSchema

        var startableBus = Bus.Create(busConfiguration);

        CreateSchema(hibernateConfig, "A");
        CreateSchema(hibernateConfig, "B");

        #endregion

        #region CapturePipelineExecutor

        PipelineExecutor = ((UnicastBus) startableBus).Builder.Build<PipelineExecutor>();

        #endregion

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


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