예제 #1
0
        private static NServiceBusConfigPackage CreateNServiceBusConfigurationPackage()
        {
            var configPackage = new NServiceBusConfigPackage();
            configPackage.InputQueueName = "NServiceBusRepro.PublisherInputQueue";
            configPackage.ErrorQueueName = "NServiceBusRepro.PublisherErrorQueue";
            configPackage.SubscriptionQueueName = "NServiceBusRepro.PublisherSubscriptionQueue";
            configPackage.DatabaseConnectionString = @"server=localhost\SQLEXPRESS;database=NServiceBusRepro;Trusted_Connection=True;";
            configPackage.DatabaseSchemaName = "dbo";
            configPackage.NumberOfFirstLevelRetries = 2;
            configPackage.NumberOfSecondLevelRetries = 2;
            configPackage.SecondLevelRetryInterval = new TimeSpan(0, 0, 10);
            configPackage.MessageMappings = new QueueMapping[]
                                                {
                                                };
            configPackage.NumberOfWorkerThreads = 4;

            return configPackage;
        }
예제 #2
0
        private static NServiceBusConfigPackage CreateNServiceBusConfigurationPackage()
        {
            var configPackage = new NServiceBusConfigPackage();
            configPackage.InputQueueName = "NServiceBusRepro.SubscriberInputQueue";
            configPackage.ErrorQueueName = "NServiceBusRepro.SubscriberErrorQueue";
            configPackage.SubscriptionQueueName = "NServiceBusRepro.SubscriberSubscriptionQueue";
            configPackage.DatabaseConnectionString = @"server=localhost\SQLEXPRESS;database=NServiceBusRepro;Trusted_Connection=True;";
            configPackage.DatabaseSchemaName = "dbo";
            configPackage.NumberOfFirstLevelRetries = 2;
            configPackage.NumberOfSecondLevelRetries = 0;
            configPackage.SecondLevelRetryInterval = new TimeSpan(0, 0, 10);
            configPackage.MessageMappings = new[]
                                                {
                                                    new QueueMapping(typeof (IFirstEvent).AssemblyQualifiedName, "NServiceBusRepro.PublisherInputQueue"),
                                                    new QueueMapping(typeof (ISecondEvent).AssemblyQualifiedName, "NServiceBusRepro.PublisherInputQueue"),
                                                    new QueueMapping(typeof (IThirdEvent).AssemblyQualifiedName, "NServiceBusRepro.PublisherInputQueue")
                                                };
            configPackage.NumberOfWorkerThreads = 8;  // Change this to increase worker threads

            return configPackage;
        }