Beispiel #1
0
 /// <summary>
 ///   Initializes a new instance of the <see cref="PluggableCheckpointStoreEventProcessor{TPartition}"/> class.
 /// </summary>
 ///
 /// <param name="checkpointStore">The provider of checkpoint and ownership data for the processor.</param>
 /// <param name="eventBatchMaximumCount">The desired number of events to include in a batch to be processed.  This size is the maximum count in a batch; the actual count may be smaller, depending on whether events are available in the Event Hub.</param>
 /// <param name="consumerGroup">The name of the consumer group the processor is associated with.  Events are read in the context of this group.</param>
 /// <param name="connectionString">The connection string to use for connecting to the Event Hubs namespace; it is expected that the Event Hub name and the shared key properties are contained in this connection string.</param>
 /// <param name="options">The set of options to use for the processor.</param>
 ///
 /// <remarks>
 ///   If the connection string is copied from the Event Hubs namespace, it will likely not contain the name of the desired Event Hub,
 ///   which is needed.  In this case, the name can be added manually by adding ";EntityPath=[[ EVENT HUB NAME ]]" to the end of the
 ///   connection string.  For example, ";EntityPath=telemetry-hub".
 ///
 ///   If you have defined a shared access policy directly on the Event Hub itself, then copying the connection string from that
 ///   Event Hub will result in a connection string that contains the name.
 /// </remarks>
 ///
 /// <exception cref="ArgumentOutOfRangeException">Occurs when the requested <paramref name="eventBatchMaximumCount"/> is less than 1.</exception>
 ///
 /// <seealso href="https://docs.microsoft.com/azure/event-hubs/event-hubs-get-connection-string">How to get an Event Hubs connection string</seealso>
 ///
 protected PluggableCheckpointStoreEventProcessor(CheckpointStore checkpointStore,
                                                  int eventBatchMaximumCount,
                                                  string consumerGroup,
                                                  string connectionString,
                                                  EventProcessorOptions options = default) : base(eventBatchMaximumCount, consumerGroup, connectionString, options)
 {
     Argument.AssertNotNull(checkpointStore, nameof(checkpointStore));
     _checkpointStore = checkpointStore;
 }
Beispiel #2
0
 /// <summary>
 ///   Initializes a new instance of the <see cref="PluggableCheckpointStoreEventProcessor{TPartition}"/> class.
 /// </summary>
 ///
 /// <param name="checkpointStore">The provider of checkpoint and ownership data for the processor.</param>
 /// <param name="eventBatchMaximumCount">The desired number of events to include in a batch to be processed.  This size is the maximum count in a batch; the actual count may be smaller, depending on whether events are available in the Event Hub.</param>
 /// <param name="consumerGroup">The name of the consumer group the processor is associated with.  Events are read in the context of this group.</param>
 /// <param name="fullyQualifiedNamespace">The fully qualified Event Hubs namespace to connect to.  This is likely to be similar to <c>{yournamespace}.servicebus.windows.net</c>.</param>
 /// <param name="eventHubName">The name of the specific Event Hub to associate the processor with.</param>
 /// <param name="credential">The Azure managed identity credential to use for authorization.  Access controls may be specified by the Event Hubs namespace or the requested Event Hub, depending on Azure configuration.</param>
 /// <param name="options">The set of options to use for the processor.</param>
 ///
 /// <exception cref="ArgumentOutOfRangeException">Occurs when the requested <paramref name="eventBatchMaximumCount"/> is less than 1.</exception>
 ///
 protected PluggableCheckpointStoreEventProcessor(CheckpointStore checkpointStore,
                                                  int eventBatchMaximumCount,
                                                  string consumerGroup,
                                                  string fullyQualifiedNamespace,
                                                  string eventHubName,
                                                  TokenCredential credential,
                                                  EventProcessorOptions options = default) : base(eventBatchMaximumCount, consumerGroup, fullyQualifiedNamespace, eventHubName, credential, options)
 {
     Argument.AssertNotNull(checkpointStore, nameof(checkpointStore));
     _checkpointStore = checkpointStore;
 }
        /// <summary>
        ///   Initializes a new instance of the <see cref="PartitionLoadBalancer" /> class.
        /// </summary>
        ///
        /// <param name="checkpointStore">Responsible for creation of checkpoints and for ownership claim.</param>
        /// <param name="identifier">The identifier of the EventProcessorClient that owns this load balancer.</param>
        /// <param name="consumerGroup">The name of the consumer group this load balancer is associated with.</param>
        /// <param name="fullyQualifiedNamespace">The fully qualified Event Hubs namespace that the processor is associated with.</param>
        /// <param name="eventHubName">The name of the Event Hub that the processor is associated with.</param>
        /// <param name="ownershipExpirationInterval">The minimum amount of time for an ownership to be considered expired without further updates.</param>
        /// <param name="loadBalancingInterval">The minimum amount of time to be elapsed between two load balancing verifications.</param>
        ///
        public PartitionLoadBalancer(CheckpointStore checkpointStore,
                                     string identifier,
                                     string consumerGroup,
                                     string fullyQualifiedNamespace,
                                     string eventHubName,
                                     TimeSpan ownershipExpirationInterval,
                                     TimeSpan loadBalancingInterval)
        {
            Argument.AssertNotNull(checkpointStore, nameof(checkpointStore));
            Argument.AssertNotNullOrEmpty(identifier, nameof(identifier));
            Argument.AssertNotNullOrEmpty(consumerGroup, nameof(consumerGroup));
            Argument.AssertNotNullOrEmpty(fullyQualifiedNamespace, nameof(fullyQualifiedNamespace));
            Argument.AssertNotNullOrEmpty(eventHubName, nameof(eventHubName));

            CheckpointStore             = checkpointStore;
            OwnerIdentifier             = identifier;
            FullyQualifiedNamespace     = fullyQualifiedNamespace;
            EventHubName                = eventHubName;
            ConsumerGroup               = consumerGroup;
            OwnershipExpirationInterval = ownershipExpirationInterval;
            LoadBalanceInterval         = loadBalancingInterval;
        }
Beispiel #4
0
 /// <summary>
 ///   Initializes a new instance of the <see cref="BlobCheckpointStore" /> class.
 /// </summary>
 ///
 /// <param name="checkpointStore">The implementation to which storage operations will be delegated.</param>
 ///
 internal BlobCheckpointStore(CheckpointStore checkpointStore) => _checkpointStoreImplementation = checkpointStore;