本文整理汇总了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>();
}
示例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>();
}
示例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();
}
}
示例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>();
}
示例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;
}
示例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
}
示例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>();
}
示例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();
}
}
示例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();
}
示例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>();
}
示例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);
}
示例12: Customize
public void Customize(BusConfiguration configuration)
{
Configure.ForAllTypes<IWantQueueCreated>(configuration.GetSettings().GetAvailableTypes(),
type => configuration.RegisterComponents(c => c.ConfigureComponent(type, DependencyLifecycle.InstancePerCall)));
}
示例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();
}
}