public MemoryTransport(TransportAbstraction.IHost host, NetheriteOrchestrationServiceSettings settings, ILogger logger) { this.host = host; this.settings = settings; TransportConnectionString.Parse(settings.ResolvedTransportConnectionString, out _, out _); this.numberPartitions = (uint)settings.PartitionCount; this.logger = logger; }
/// <summary> /// Creates an instance of the scaling monitor, with the given parameters. /// </summary> /// <param name="storageConnectionString">The storage connection string.</param> /// <param name="eventHubsConnectionString">The connection string for the transport layer.</param> /// <param name="partitionLoadTableName">The name of the storage table with the partition load information.</param> /// <param name="taskHubName">The name of the taskhub.</param> public ScalingMonitor(string storageConnectionString, string eventHubsConnectionString, string partitionLoadTableName, string taskHubName) { this.storageConnectionString = storageConnectionString; this.eventHubsConnectionString = eventHubsConnectionString; this.partitionLoadTableName = partitionLoadTableName; this.taskHubName = taskHubName; TransportConnectionString.Parse(eventHubsConnectionString, out _, out this.configuredTransport); this.table = new AzureLoadMonitorTable(storageConnectionString, partitionLoadTableName, taskHubName); }
public void Configure(Configure config) { var connectionString = TransportConnectionString.GetConnectionStringOrNull(); if (connectionString == null && RequiresConnectionString) { throw new InvalidOperationException(String.Format(Message, GetConfigFileIfExists(), typeof(T).Name, ExampleConnectionStringForErrorMessage)); } SettingsHolder.Set("NServiceBus.Transport.ConnectionString", connectionString); SettingsHolder.Set("NServiceBus.Transport.SelectedTransport", Activator.CreateInstance <T>()); InternalConfigure(config); }
public EventHubsTransport(TransportAbstraction.IHost host, NetheriteOrchestrationServiceSettings settings, ILoggerFactory loggerFactory) { this.host = host; this.settings = settings; this.cloudStorageAccount = CloudStorageAccount.Parse(this.settings.ResolvedStorageConnectionString); string namespaceName = TransportConnectionString.EventHubsNamespaceName(settings.ResolvedTransportConnectionString); this.traceHelper = new EventHubsTraceHelper(loggerFactory, settings.TransportLogLevelLimit, this.cloudStorageAccount.Credentials.AccountName, settings.HubName, namespaceName); this.ClientId = Guid.NewGuid(); var blobContainerName = GetContainerName(settings.HubName); var cloudBlobClient = this.cloudStorageAccount.CreateCloudBlobClient(); this.cloudBlobContainer = cloudBlobClient.GetContainerReference(blobContainerName); this.taskhubParameters = this.cloudBlobContainer.GetBlockBlobReference("taskhubparameters.json"); this.partitionScript = this.cloudBlobContainer.GetBlockBlobReference("partitionscript.json"); }
static void Main(string[] args) { TransportConnectionString.Override(() => "deadLetter=false;journal=false"); var testCaseToRun = args[0]; int numberOfThreads; if (!int.TryParse(testCaseToRun, out numberOfThreads)) { var testCase = TestCase.Load(testCaseToRun, args); testCase.Run(); testCase.DumpSettings(); return; } var volatileMode = (args[4].ToLower() == "volatile"); var suppressDTC = (args[4].ToLower() == "suppressdtc"); var twoPhaseCommit = (args[4].ToLower() == "twophasecommit"); var saga = (args[5].ToLower() == "sagamessages"); var encryption = (args[5].ToLower() == "encryption"); var concurrency = int.Parse(args[7]); TransportConfigOverride.MaximumConcurrencyLevel = numberOfThreads; var numberOfMessages = int.Parse(args[1]); var endpointName = "PerformanceTest"; if (volatileMode) { endpointName += ".Volatile"; } if (suppressDTC) { endpointName += ".SuppressDTC"; } var config = Configure.With() .DefineEndpointName(endpointName) .DefaultBuilder(); switch (args[2].ToLower()) { case "xml": Configure.Serialization.Xml(); break; case "json": Configure.Serialization.Json(); break; case "bson": Configure.Serialization.Bson(); break; case "bin": Configure.Serialization.Binary(); break; default: throw new InvalidOperationException("Illegal serialization format " + args[2]); } Configure.Features.Disable <Audit>(); if (saga) { Configure.Features.Enable <Sagas>(); config.RavenSagaPersister(); } if (volatileMode) { Configure.Endpoint.AsVolatile(); } if (suppressDTC) { Configure.Transactions.Advanced(settings => settings.DisableDistributedTransactions()); } if (encryption) { SetupRijndaelTestEncryptionService(); } switch (args[3].ToLower()) { case "msmq": config.UseTransport <Msmq>(); break; default: throw new InvalidOperationException("Illegal transport " + args[2]); } using (var startableBus = config.InMemoryFaultManagement().UnicastBus().CreateBus()) { Configure.Instance.ForInstallationOn <NServiceBus.Installation.Environments.Windows>().Install(); if (saga) { SeedSagaMessages(numberOfMessages, endpointName, concurrency); } else { Statistics.SendTimeNoTx = SeedInputQueue(numberOfMessages / 2, endpointName, numberOfThreads, false, twoPhaseCommit, encryption); Statistics.SendTimeWithTx = SeedInputQueue(numberOfMessages / 2, endpointName, numberOfThreads, true, twoPhaseCommit, encryption); } Statistics.StartTime = DateTime.Now; startableBus.Start(); while (Interlocked.Read(ref Statistics.NumberOfMessages) < numberOfMessages) { Thread.Sleep(1000); } DumpSetting(args); Statistics.Dump(); } }