-
Notifications
You must be signed in to change notification settings - Fork 5.1k
[Event Hubs Client] Shared Key Credential + Connection String Parser #16044
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -405,6 +405,33 @@ public EventProcessorClient(BlobContainerClient checkpointStore, | |
| StorageManager = CreateStorageManager(checkpointStore); | ||
| } | ||
|
|
||
| /// <summary> | ||
| /// Initializes a new instance of the <see cref="EventProcessorClient"/> class. | ||
| /// </summary> | ||
| /// | ||
| /// <param name="checkpointStore">The client responsible for persisting checkpoints and processor state to durable storage. The associated container is expected to exist.</param> | ||
| /// <param name="consumerGroup">The name of the consumer group this 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 Event Hubs shared access key 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="clientOptions">The set of options to use for this processor.</param> | ||
| /// | ||
| /// <remarks> | ||
| /// The container associated with the <paramref name="checkpointStore" /> is expected to exist; the <see cref="EventProcessorClient" /> | ||
| /// does not assume the ability to manage the storage account and is safe to run without permission to manage the storage account. | ||
| /// </remarks> | ||
| /// | ||
| public EventProcessorClient(BlobContainerClient checkpointStore, | ||
| string consumerGroup, | ||
| string fullyQualifiedNamespace, | ||
| string eventHubName, | ||
| EventHubsSharedAccessKeyCredential credential, | ||
| EventProcessorClientOptions clientOptions = default) : base((clientOptions ?? DefaultClientOptions).CacheEventCount, consumerGroup, fullyQualifiedNamespace, eventHubName, credential, CreateOptions(clientOptions)) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is it ok that the first arg to the base ctor conditionally passes
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Scared me there. The first argument sets the batch size using either the specified option or the default size. The latter translates the derived options into the base type and passes it as the options set. The |
||
| { | ||
| Argument.AssertNotNull(checkpointStore, nameof(checkpointStore)); | ||
| StorageManager = CreateStorageManager(checkpointStore); | ||
| } | ||
|
|
||
| /// <summary> | ||
| /// Initializes a new instance of the <see cref="EventProcessorClient"/> class. | ||
| /// </summary> | ||
|
|
@@ -432,6 +459,36 @@ public EventProcessorClient(BlobContainerClient checkpointStore, | |
| StorageManager = CreateStorageManager(checkpointStore); | ||
| } | ||
|
|
||
| /// <summary> | ||
| /// Initializes a new instance of the <see cref="EventProcessorClient"/> class. | ||
| /// </summary> | ||
| /// | ||
| /// <param name="storageManager">Responsible for creation of checkpoints and for ownership claim.</param> | ||
| /// <param name="consumerGroup">The name of the consumer group this 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="cacheEventCount">The maximum number of events that will be read from the Event Hubs service and held in a local memory cache when reading is active and events are being emitted to an enumerator for processing.</param> | ||
| /// <param name="credential">A shared access key credential to satisfy base class requirements; this credential may not be <c>null</c> but will only be used in the case that <see cref="CreateConnection" /> has not been overridden.</param> | ||
| /// <param name="clientOptions">The set of options to use for this processor.</param> | ||
| /// | ||
| /// <remarks> | ||
| /// This constructor is intended only to support functional testing and mocking; it should not be used for production scenarios. | ||
| /// </remarks> | ||
| /// | ||
| internal EventProcessorClient(StorageManager storageManager, | ||
| string consumerGroup, | ||
| string fullyQualifiedNamespace, | ||
| string eventHubName, | ||
| int cacheEventCount, | ||
| EventHubsSharedAccessKeyCredential credential, | ||
| EventProcessorOptions clientOptions) : base(cacheEventCount, consumerGroup, fullyQualifiedNamespace, eventHubName, credential, clientOptions) | ||
| { | ||
| Argument.AssertNotNull(storageManager, nameof(storageManager)); | ||
|
|
||
| DefaultStartingPosition = (clientOptions?.DefaultStartingPosition ?? DefaultStartingPosition); | ||
| StorageManager = storageManager; | ||
| } | ||
|
|
||
| /// <summary> | ||
| /// Initializes a new instance of the <see cref="EventProcessorClient"/> class. | ||
| /// </summary> | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.