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

# FileSystemQueueProcessor

> Processes queue items stored in the local file system and dispatches them to all [IMessageHandler](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Core/IMessageH...

## Definition

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

**Namespace:** CloudNimble.SimpleMessageBus.Dispatch

**Inheritance:** System.Object

## Syntax

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

## Summary

Processes queue items stored in the local file system and dispatches them to all [IMessageHandler](/api-reference/CloudNimble/SimpleMessageBus/Core/IMessageHandler)IMessageHandlers\</see> registered with the DI container.

## Remarks

This processor monitors a configured file system directory for new message files and automatically
processes them when they appear. It supports three-folder operation: queue (incoming), completed
(successfully processed), and error (failed processing). The processor integrates with Azure WebJobs
for file system monitoring and automatic triggering.

## Constructors

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

The default constructor called by the Dependency Injection container.

#### Syntax

```csharp theme={"dark"}
public FileSystemQueueProcessor(Microsoft.Extensions.Options.IOptions<CloudNimble.SimpleMessageBus.Core.FileSystemOptions> options, CloudNimble.SimpleMessageBus.Dispatch.IMessageDispatcher dispatcher, Microsoft.Extensions.DependencyInjection.IServiceScopeFactory serviceScopeFactory)
```

#### Parameters

| Name                                  | Type                                                                                         | Description                                                                                                                                                                                                                                                                                         |
| ------------------------------------- | -------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `options`                             | `Microsoft.Extensions.Options.IOptions<CloudNimble.SimpleMessageBus.Core.FileSystemOptions>` | The injected [IOptions\`1](https://learn.microsoft.com/dotnet/api/microsoft.extensions.options.ioptions-1) specifying the options required to leverage the local file system as the SimpleMessageBus backing queue.                                                                                 |
| `dispatcher`                          | `CloudNimble.SimpleMessageBus.Dispatch.IMessageDispatcher`                                   | The message dispatcher to route messages to handlers.                                                                                                                                                                                                                                               |
| `serviceScopeFactory`                 | `Microsoft.Extensions.DependencyInjection.IServiceScopeFactory`                              | The Dependency Injection container's [IServiceProvider](https://learn.microsoft.com/dotnet/api/system.iserviceprovider) instance, so that a "per-request" scope can be created that gives each [MessageEnvelope](/simplemessagebus/api-reference/CloudNimble/SimpleMessageBus/Core/MessageEnvelope) |
| its own set of isolated dependencies. |                                                                                              |                                                                                                                                                                                                                                                                                                     |

### <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 file when it appears in the queue directory.

#### Syntax

```csharp theme={"dark"}
public System.Threading.Tasks.Task ProcessQueue(string messageEnvelopeJson, System.IO.FileSystemEventArgs fileTrigger, Microsoft.Extensions.Logging.ILogger logger)
```

#### Parameters

| Name                  | Type                                   | Description                                           |
| --------------------- | -------------------------------------- | ----------------------------------------------------- |
| `messageEnvelopeJson` | `string`                               | The JSON content of the message envelope file.        |
| `fileTrigger`         | `System.IO.FileSystemEventArgs`        | The file system event that triggered this processing. |
| `logger`              | `Microsoft.Extensions.Logging.ILogger` | The logger instance for this processing operation.    |

#### Returns

Type: `System.Threading.Tasks.Task`

#### Remarks

This method is triggered automatically by the Azure WebJobs framework when files are created
or renamed in the queue directory. It deserializes the message and dispatches it to handlers.

### <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
