/// <summary> /// Create a new host to process events from an Event Hub. /// /// <para>Since Event Hubs are frequently used for scale-out, high-traffic scenarios, generally there will /// be only one host per process, and the processes will be run on separate machines. However, it is /// supported to run multiple hosts on one machine, or even within one process, if throughput is not /// a concern.</para> /// /// This overload of the constructor uses the default, built-in lease and checkpoint managers. The /// Azure Storage account specified by the storageConnectionString parameter is used by the built-in /// managers to record leases and checkpoints. /// </summary> /// <param name="eventHubPath">The name of the EventHub.</param> /// <param name="consumerGroupName">The name of the consumer group within the Event Hub.</param> /// <param name="eventHubConnectionString">Connection string for the Event Hub to receive from.</param> /// <param name="storageConnectionString">Connection string to Azure Storage account used for leases and checkpointing.</param> /// <param name="leaseContainerName">Azure Storage container name for use by built-in lease and checkpoint manager.</param> public EventProcessorHost( string eventHubPath, string consumerGroupName, string eventHubConnectionString, string storageConnectionString, string leaseContainerName) : this(EventProcessorHost.CreateHostName(null), eventHubPath, consumerGroupName, eventHubConnectionString, storageConnectionString, leaseContainerName) { }
/// <summary> /// Create a new host to process events from an Event Hub with provided <see cref="TokenProvider"/> /// </summary> /// <param name="endpointAddress">Fully qualified domain name for Event Hubs. Most likely, {yournamespace}.servicebus.windows.net</param> /// <param name="eventHubPath">The name of the EventHub.</param> /// <param name="consumerGroupName">The name of the consumer group within the Event Hub.</param> /// <param name="tokenProvider">Token provider which will generate security tokens for authorization.</param> /// <param name="cloudStorageAccount">Azure Storage account used for leases and checkpointing.</param> /// <param name="leaseContainerName">Azure Storage container name for use by built-in lease and checkpoint manager.</param> public EventProcessorHost( Uri endpointAddress, string eventHubPath, string consumerGroupName, ITokenProvider tokenProvider, CloudStorageAccount cloudStorageAccount, string leaseContainerName) : this(EventProcessorHost.CreateHostName(null), endpointAddress, eventHubPath, consumerGroupName, tokenProvider, cloudStorageAccount, leaseContainerName) { }
/// <summary> /// Create a new host to process events from an Event Hub with provided <see cref="TokenProvider"/> /// </summary> /// <param name="endpointAddress">Fully qualified domain name for Event Hubs. Most likely, {yournamespace}.servicebus.windows.net</param> /// <param name="eventHubPath">The name of the EventHub.</param> /// <param name="consumerGroupName">The name of the consumer group within the Event Hub.</param> /// <param name="tokenProvider">Token provider which will generate security tokens for authorization.</param> /// <param name="cloudStorageAccount">Azure Storage account used for leases and checkpointing.</param> /// <param name="leaseContainerName">Azure Storage container name for use by built-in lease and checkpoint manager.</param> /// <param name="storageBlobPrefix">Prefix used when naming blobs within the storage container.</param> /// <param name="operationTimeout">Operation timeout for Event Hubs operations.</param> /// <param name="transportType">Transport type on connection.</param> public EventProcessorHost( Uri endpointAddress, string eventHubPath, string consumerGroupName, ITokenProvider tokenProvider, CloudStorageAccount cloudStorageAccount, string leaseContainerName, string storageBlobPrefix = null, TimeSpan?operationTimeout = null, TransportType transportType = TransportType.Amqp) : this(EventProcessorHost.CreateHostName(null), endpointAddress, eventHubPath, consumerGroupName, tokenProvider, cloudStorageAccount, leaseContainerName, storageBlobPrefix, operationTimeout, transportType) { }