Class AzureQueueOptions
- Namespace
- Savvyio.Extensions.QueueStorage
- Assembly
- Savvyio.Extensions.QueueStorage.dll
Configuration options for AzureQueue<TRequest>.
public class AzureQueueOptions : IValidatableParameterObject, IParameterObject
- Inheritance
-
AzureQueueOptions
- Implements
- Derived
Constructors
AzureQueueOptions()
Initializes a new instance of the AzureQueueOptions class.
public AzureQueueOptions()
Remarks
The following table shows the initial property values for an instance of AzureQueueOptions.
| Property | Initial Value |
|---|---|
| Credential | new DefaultAzureCredential() |
| StorageAccountName | null |
| Settings | new QueueClientOptions() |
| ReceiveContext | new AzureQueueReceiveOptions() |
| SendContext | new AzureQueueSendOptions() |
| QueueName | null |
| SasCredential | null |
| StorageKeyCredential | null |
| ConnectionString | null |
Fields
MaxNumberOfMessages
The maximum number of messages that Azure Queue Storage supports when retrieving.
public const int MaxNumberOfMessages = 32
Field Value
MaxVisibilityTimeout
The maximum visibility timeout for messages in Azure Queue Storage.
public static readonly TimeSpan MaxVisibilityTimeout
Field Value
Properties
ConnectionString
Gets or sets the connection string used to connect to the Azure storage account.
public string ConnectionString { get; set; }
Property Value
Credential
Gets or sets the credential used to authenticate with Azure.
public TokenCredential Credential { get; set; }
Property Value
Remarks
Setting this property will nullify SasCredential and StorageKeyCredential as they are mutually exclusive.
QueueName
Gets or sets the name of the queue.
public string QueueName { get; set; }
Property Value
ReceiveContext
Gets the options for receiving messages from the queue.
public AzureQueueReceiveOptions ReceiveContext { get; }
Property Value
SasCredential
Gets or sets the SAS credential used to authenticate with Azure.
public AzureSasCredential SasCredential { get; set; }
Property Value
Remarks
Setting this property will nullify Credential and StorageKeyCredential as they are mutually exclusive.
SendContext
Gets the options for sending messages to the queue.
public AzureQueueSendOptions SendContext { get; }
Property Value
Settings
Gets the settings for the QueueClient>.
public QueueClientOptions Settings { get; }
Property Value
StorageAccountName
Gets or sets the name of the storage account.
public string StorageAccountName { get; set; }
Property Value
StorageKeyCredential
Gets or sets the storage key credential used to authenticate with Azure.
public StorageSharedKeyCredential StorageKeyCredential { get; set; }
Property Value
Remarks
Setting this property will nullify Credential and SasCredential as they are mutually exclusive.
Methods
PostConfigureClient(Action<QueueClient>)
Provides a way to post-configure the client after it has been created.
public AzureQueueOptions PostConfigureClient(Action<QueueClient> factory)
Parameters
factoryAction<QueueClient>The delegate to post-configure the client.
Returns
- AzureQueueOptions
A reference to this instance.
Remarks
This was added to support invoking methods of interest: https://learn.microsoft.com/en-us/dotnet/api/azure.storage.queues.queueclient?view=azure-dotnet#methods
ValidateOptions()
Validates the options to ensure they are in a valid state.
public void ValidateOptions()
Exceptions
- InvalidOperationException
QueueName cannot be null, empty, or consists only of white-space characters when ConnectionString was specified -or- Credential and SasCredential and StorageKeyCredential cannot be null -or- StorageAccountName and QueueName cannot be null, empty, or consists only of white-space characters.