Beispiel #1
0
 public ScriptedEventProcessorHost(
     string eventHubPath,
     string consumerGroupName,
     string eventHubConnectionString,
     string storageConnectionString,
     string leaseContainerName,
     TransportAbstraction.IHost host,
     TransportAbstraction.ISender sender,
     EventHubsConnections connections,
     TaskhubParameters parameters,
     NetheriteOrchestrationServiceSettings settings,
     EventHubsTraceHelper logger,
     string workerId)
 {
     this.eventHubPath             = eventHubPath;
     this.consumerGroupName        = consumerGroupName;
     this.eventHubConnectionString = eventHubConnectionString;
     this.storageConnectionString  = storageConnectionString;
     this.leaseContainerName       = leaseContainerName;
     this.host        = host;
     this.sender      = sender;
     this.connections = connections;
     this.parameters  = parameters;
     this.taskHubGuid = parameters.TaskhubGuid.ToByteArray();
     this.settings    = settings;
     this.logger      = logger;
     this.workerId    = workerId;
 }
Beispiel #2
0
 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;
 }
        readonly MemoryStream stream = new MemoryStream(); // reused for all packets

        public EventHubsSender(TransportAbstraction.IHost host, byte[] taskHubGuid, PartitionSender sender, EventHubsTraceHelper traceHelper)
            : base(nameof(EventHubsSender <T>), false, 2000, CancellationToken.None)
        {
            this.host              = host;
            this.taskHubGuid       = taskHubGuid;
            this.sender            = sender;
            this.traceHelper       = traceHelper;
            this.eventHubName      = this.sender.EventHubClient.EventHubName;
            this.eventHubPartition = this.sender.PartitionId;
        }
Beispiel #4
0
        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");
        }