> ## Documentation Index
> Fetch the complete documentation index at: https://easyaf.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# AzureStorageQueueProcessor

> Processes messages from Azure Storage Queues and dispatches them to registered message handlers.

## Definition

**Assembly:** CloudNimble.SimpleMessageBus.Dispatch.Azure.dll

**Namespace:** CloudNimble.SimpleMessageBus.Dispatch

**Inheritance:** System.Object

## Syntax

```csharp theme={"dark"}
CloudNimble.SimpleMessageBus.Dispatch.AzureStorageQueueProcessor
```

## Summary

Processes messages from Azure Storage Queues and dispatches them to registered message handlers.

## Remarks

This processor integrates with Azure WebJobs to automatically trigger message processing when
messages arrive in Azure Storage Queues. It handles message deserialization, lifecycle management,
and provides proper logging and dependency injection scope for each message.

## Constructors

### <Icon icon="hammer" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> .ctor

Initializes a new instance of the [AzureStorageQueueProcessor](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Dispatch/AzureStorageQueueProcessor) class.

#### Syntax

```csharp theme={"dark"}
public AzureStorageQueueProcessor(CloudNimble.SimpleMessageBus.Dispatch.IMessageDispatcher dispatcher, Microsoft.Extensions.DependencyInjection.IServiceScopeFactory serviceScopeFactory)
```

#### Parameters

| Name                  | Type                                                            | Description                                                   |
| --------------------- | --------------------------------------------------------------- | ------------------------------------------------------------- |
| `dispatcher`          | `CloudNimble.SimpleMessageBus.Dispatch.IMessageDispatcher`      | The message dispatcher to route messages to handlers.         |
| `serviceScopeFactory` | `Microsoft.Extensions.DependencyInjection.IServiceScopeFactory` | The service scope factory for creating DI scopes per message. |

#### Exceptions

| Exception               | Description                                                |
| ----------------------- | ---------------------------------------------------------- |
| `ArgumentNullException` | Thrown when *dispatcher* or *serviceScopeFactory* is null. |

### <Icon icon="hammer" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> .ctor <Badge color="gray">Inherited</Badge>

<Note>Inherited from `object`</Note>

#### Syntax

```csharp theme={"dark"}
public Object()
```

## Methods

### <Icon icon="code-fork" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> Equals <Badge color="gray">Inherited</Badge> <Badge color="orange">Virtual</Badge>

<Note>Inherited from `object`</Note>

#### Syntax

```csharp theme={"dark"}
public virtual bool Equals(object obj)
```

#### Parameters

| Name  | Type      | Description |
| ----- | --------- | ----------- |
| `obj` | `object?` | -           |

#### Returns

Type: `bool`

### <Icon icon="thumbtack" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> Equals <Badge color="gray">Inherited</Badge>

<Note>Inherited from `object`</Note>

#### Syntax

```csharp theme={"dark"}
public static bool Equals(object objA, object objB)
```

#### Parameters

| Name   | Type      | Description |
| ------ | --------- | ----------- |
| `objA` | `object?` | -           |
| `objB` | `object?` | -           |

#### Returns

Type: `bool`

### <Icon icon="code-fork" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> GetHashCode <Badge color="gray">Inherited</Badge> <Badge color="orange">Virtual</Badge>

<Note>Inherited from `object`</Note>

#### Syntax

```csharp theme={"dark"}
public virtual int GetHashCode()
```

#### Returns

Type: `int`

### <Icon icon="function" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> GetType <Badge color="gray">Inherited</Badge>

<Note>Inherited from `object`</Note>

#### Syntax

```csharp theme={"dark"}
public System.Type GetType()
```

#### Returns

Type: `System.Type`

### <Icon icon="function" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> MemberwiseClone <Badge color="gray">Inherited</Badge>

<Note>Inherited from `object`</Note>

#### Syntax

```csharp theme={"dark"}
protected internal object MemberwiseClone()
```

#### Returns

Type: `object`

### <Icon icon="function" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> ProcessQueue

Processes a message from the Azure Storage Queue and dispatches it to registered handlers.

#### Syntax

```csharp theme={"dark"}
public System.Threading.Tasks.Task<Azure.Storage.Queues.Models.QueueMessage> ProcessQueue(Azure.Storage.Queues.Models.QueueMessage queueMessage, Microsoft.Extensions.Logging.ILogger logger)
```

#### Parameters

| Name           | Type                                       | Description                                        |
| -------------- | ------------------------------------------ | -------------------------------------------------- |
| `queueMessage` | `Azure.Storage.Queues.Models.QueueMessage` | The Azure Storage Queue message to process.        |
| `logger`       | `Microsoft.Extensions.Logging.ILogger`     | The logger instance for this processing operation. |

#### Returns

Type: `System.Threading.Tasks.Task<Azure.Storage.Queues.Models.QueueMessage>`
The processed queue message, which will be moved to the completed queue if configured.

#### Remarks

This method is triggered automatically by the Azure WebJobs framework when messages arrive.
It deserializes the message envelope, sets up processing context, and dispatches to handlers.
If processing succeeds, the message is optionally moved to a completion queue.

### <Icon icon="thumbtack" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> ReferenceEquals <Badge color="gray">Inherited</Badge>

<Note>Inherited from `object`</Note>

#### Syntax

```csharp theme={"dark"}
public static bool ReferenceEquals(object objA, object objB)
```

#### Parameters

| Name   | Type      | Description |
| ------ | --------- | ----------- |
| `objA` | `object?` | -           |
| `objB` | `object?` | -           |

#### Returns

Type: `bool`

### <Icon icon="code-fork" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> ToString <Badge color="gray">Inherited</Badge> <Badge color="orange">Virtual</Badge>

<Note>Inherited from `object`</Note>

#### Syntax

```csharp theme={"dark"}
public virtual string ToString()
```

#### Returns

Type: `string?`

## Related APIs

* CloudNimble.SimpleMessageBus.Dispatch.IQueueProcessor
