示例#1
0
        private IBus ConfigureNServiceBus()
        {
            var configuration = new BusConfiguration();

            configuration.AssembliesToScan(AllAssemblies.Except("MediaLoanLIbrary.Fines.Common"));
            configuration.EndpointName("IntegrationTesting");
            configuration.DisableFeature <Sagas>();
            configuration.DisableFeature <TimeoutManager>();
            configuration.DisableFeature <AutoSubscribe>();
            configuration.DisableFeature <InMemorySubscriptionPersistence>();
            configuration.DisableFeature <StorageDrivenPublishing>();
            configuration.UsePersistence <InMemoryPersistence>();
            configuration.PurgeOnStartup(true);
            configuration.Conventions()
            .DefiningCommandsAs(type => UnobtrusiveMessageConventions.CommandsDefinition(type) || (UnobtrusiveMessageConventions.EventsDefinition(type) && type.Namespace.Contains(".Loans.")))
            .DefiningEventsAs(type => UnobtrusiveMessageConventions.EventsDefinition(type) && !type.Namespace.Contains(".Loans."));
            configuration.EnableInstallers();
            return(Bus.Create(configuration).Start());
        }
示例#2
0
 private bool ExecuteEventsDefinitionOnType(Type type)
 {
     return(UnobtrusiveMessageConventions.EventsDefinition(type));
 }