本文整理汇总了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>();
}
示例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>();
}
示例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>();
}
示例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();
}
}
示例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>();
}
示例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
}
示例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();
}
示例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();
}
示例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
}
示例10: Customize
public void Customize(BusConfiguration configuration)
{
configuration.UsePersistence<InMemoryPersistence>();
configuration.UseTransport<AzureServiceBusTransport>();
configuration.EnableFeature<MessageDrivenSubscriptions>();
}
示例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();
}
}
示例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>();
}
示例13: GatewayConfig
public GatewayConfig()
{
#region GatewayConfiguration-v5
var configuration = new BusConfiguration();
configuration.EnableFeature<Gateway>();
#endregion
}
示例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));
}
示例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"));
}