本文整理汇总了C#中BusConfiguration.PurgeOnStartup方法的典型用法代码示例。如果您正苦于以下问题:C# BusConfiguration.PurgeOnStartup方法的具体用法?C# BusConfiguration.PurgeOnStartup怎么用?C# BusConfiguration.PurgeOnStartup使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BusConfiguration
的用法示例。
在下文中一共展示了BusConfiguration.PurgeOnStartup方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetConfiguration
public BusConfiguration GetConfiguration(RunDescriptor runDescriptor, EndpointConfiguration endpointConfiguration, IConfigurationSource configSource, Action<BusConfiguration> configurationBuilderCustomization)
{
var settings = runDescriptor.Settings;
var types = GetTypesToUse(endpointConfiguration);
var config = new BusConfiguration();
config.EndpointName(endpointConfiguration.EndpointName);
config.TypesToScan(types);
config.CustomConfigurationSource(configSource);
config.UsePersistence<InMemoryPersistence>();
config.PurgeOnStartup(true);
// Plugin a behavior that listens for subscription messages
config.Pipeline.Register<SubscriptionBehavior.Registration>();
config.RegisterComponents(c => c.ConfigureComponent<SubscriptionBehavior>(DependencyLifecycle.InstancePerCall));
// Important: you need to make sure that the correct ScenarioContext class is available to your endpoints and tests
config.RegisterComponents(r =>
{
r.RegisterSingleton(runDescriptor.ScenarioContext.GetType(), runDescriptor.ScenarioContext);
r.RegisterSingleton(typeof(ScenarioContext), runDescriptor.ScenarioContext);
});
// Call extra custom action if provided
if (configurationBuilderCustomization != null)
{
configurationBuilderCustomization(config);
}
return config;
}
示例2: 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>();
}
示例3: Customize
public void Customize(BusConfiguration busConfiguration)
{
busConfiguration.PurgeOnStartup(true);
var endpointName = "memleaktest";
busConfiguration.EndpointName(endpointName);
busConfiguration.EnableInstallers();
busConfiguration.UseSerialization<JsonSerializer>();
busConfiguration.UsePersistence<InMemoryPersistence>();
}
示例4: Simple
public void Simple()
{
#region PurgeOnStartupV5
var configuration = new BusConfiguration();
configuration.PurgeOnStartup(true);
#endregion
}
示例5: RegisterBus
private void RegisterBus()
{
var busConfiguration = new BusConfiguration();
busConfiguration.UseSerialization<JsonSerializer>();
busConfiguration.UseTransport<MsmqTransport>();
busConfiguration.Transactions().Disable();
busConfiguration.PurgeOnStartup(false);
LogManager.Use<NServiceBus.Log4Net.Log4NetFactory>();
Bus = NServiceBus.Bus.CreateSendOnly(busConfiguration);
}
示例6: 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
}
示例7: Application_Start
protected void Application_Start()
{
BusConfiguration configuration = new BusConfiguration();
configuration.EndpointName("Store.ECommerce");
configuration.PurgeOnStartup(true);
configuration.ApplyCommonConfiguration();
Bus = NServiceBus.Bus.Create(configuration).Start();
AreaRegistration.RegisterAllAreas();
FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
RouteConfig.RegisterRoutes(RouteTable.Routes);
}
示例8: Customize
public void Customize(BusConfiguration busConfiguration)
{
var container = new Container(x => x.AddRegistry<StructureMapRegistry>());
busConfiguration.UseContainer<StructureMapBuilder>(x => x.ExistingContainer(container));
busConfiguration.PurgeOnStartup(false);
busConfiguration.UseSerialization<JsonSerializer>();
busConfiguration.EnableInstallers();
busConfiguration.UsePersistence<InMemoryPersistence>();
busConfiguration.EndpointName("Case16203");
BasicConfigurator.Configure();
LogManager.Use<Log4NetFactory>();
}
示例9: AsyncStart
static async Task AsyncStart()
{
var busConfiguration = new BusConfiguration();
busConfiguration.EndpointName("Store.ECommerce");
busConfiguration.PurgeOnStartup(true);
busConfiguration.ApplyCommonConfiguration();
busConfiguration.SendFailedMessagesTo("error");
Bus = await NServiceBus.Bus.Create(busConfiguration).StartAsync();
AreaRegistration.RegisterAllAreas();
FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
RouteConfig.RegisterRoutes(RouteTable.Routes);
}
示例10: Main
static void Main()
{
var busConfig = new BusConfiguration();
busConfig.EndpointName("JilSerializer.Perf.Core");
busConfig.UseSerialization<JsonSerializer>();
busConfig.EnableInstallers();
busConfig.PurgeOnStartup(true);
busConfig.UsePersistence<InMemoryPersistence>();
busConfig.UseTransport<MsmqTransport>().ConnectionString("deadLetter=false;journal=false");
busConfig.DisableFeature<Audit>();
using (var bus = Bus.Create(busConfig))
{
bus.Start();
MessageSender.SendMessages(bus);
}
}
示例11: Create
public static IBus Create()
{
var config = new BusConfiguration();
config.ScaleOut().UseSingleBrokerQueue();
config.Transactions().EnableDistributedTransactions();
config.UseTransport<SqlServerTransport>();
config.UsePersistence<NHibernatePersistence, StorageType.Sagas>();
config.UsePersistence<NHibernatePersistence, StorageType.Subscriptions>();
config.UsePersistence<NHibernatePersistence, StorageType.Timeouts>();
config.UsePersistence<NHibernatePersistence, StorageType.Outbox>();
config.PurgeOnStartup(false);
config.EnableInstallers();
return Bus.Create(config);
}
示例12: Customize
public void Customize(BusConfiguration configuration)
{
configuration.UseSerialization<Json>();
configuration.EnableInstallers();
configuration.UsePersistence<InMemoryPersistence>();
configuration.UseTransport<MsmqTransport>();
configuration.PurgeOnStartup(false);
configuration.RegisterComponents(c =>
{
c.ConfigureComponent<AuthenticationService>(DependencyLifecycle.InstancePerUnitOfWork);
c.ConfigureComponent<Repository>(DependencyLifecycle.InstancePerUnitOfWork);
c.ConfigureComponent<ValidationService>(DependencyLifecycle.SingleInstance);
c.ConfigureComponent<MutateIncomingTransportMessages>(DependencyLifecycle.InstancePerCall);
c.ConfigureComponent<ValidateIncomingMessages>(DependencyLifecycle.InstancePerCall);
c.ConfigureComponent<DataRepository>(DependencyLifecycle.InstancePerUnitOfWork);
});
}
示例13: Init
public static void Init()
{
if (Bus != null)
return;
lock (padlock)
{
if (Bus != null)
return;
var cfg = new BusConfiguration();
cfg.UseTransport<MsmqTransport>();
cfg.UsePersistence<InMemoryPersistence>();
cfg.PurgeOnStartup(true);
cfg.EnableInstallers();
Bus = NServiceBus.Bus.CreateSendOnly(cfg);
}
}
示例14: Application_Start
protected void Application_Start()
{
var configuration = new BusConfiguration();
UnobtrusiveMessageConventions.Init(configuration.Conventions());
configuration.UseTransport<RabbitMQTransport>();
configuration.UsePersistence<InMemoryPersistence>();
configuration.PurgeOnStartup(true);
configuration.RijndaelEncryptionService();
configuration.EnableInstallers();
Bus = NServiceBus.Bus.Create(configuration).Start();
AreaRegistration.RegisterAllAreas();
FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
RouteConfig.RegisterRoutes(RouteTable.Routes);
}
示例15: Application_Start
protected void Application_Start()
{
var config = new BusConfiguration();
config.Conventions()
.DefiningCommandsAs(t => t.Namespace != null && (t.Namespace.StartsWith("Commands") || t.Namespace.Contains("Commands")))
.DefiningEventsAs(t => t.Namespace != null && (t.Namespace.EndsWith("Events") || t.Namespace.EndsWith("Notifications")));
LogManager.Use<DefaultFactory>().Directory("c:/temp");
config.UseTransport<AzureServiceBusTransport>();
//config.UsePersistence<AzureStoragePersistence>();
config.PurgeOnStartup(true);
config.EnableInstallers();
_bus = NServiceBus.Bus.CreateSendOnly(config);
AreaRegistration.RegisterAllAreas();
GlobalConfiguration.Configure(WebApiConfig.Register);
}