Skip to main content

Definition

Assembly: CloudNimble.SimpleMessageBus.Dispatch.FileSystem.dll Namespace: CloudNimble.SimpleMessageBus.Dispatch Inheritance: System.Object

Syntax

CloudNimble.SimpleMessageBus.Dispatch.FileSystemQueueProcessor

Summary

Processes queue items stored in the local file system and dispatches them to all IMessageHandlerIMessageHandlers</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

.ctor

The default constructor called by the Dependency Injection container.

Syntax

public FileSystemQueueProcessor(Microsoft.Extensions.Options.IOptions<CloudNimble.SimpleMessageBus.Core.FileSystemOptions> options, CloudNimble.SimpleMessageBus.Dispatch.IMessageDispatcher dispatcher, Microsoft.Extensions.DependencyInjection.IServiceScopeFactory serviceScopeFactory)

Parameters

NameTypeDescription
optionsMicrosoft.Extensions.Options.IOptions<CloudNimble.SimpleMessageBus.Core.FileSystemOptions>The injected IOptions`1 specifying the options required to leverage the local file system as the SimpleMessageBus backing queue.
dispatcherCloudNimble.SimpleMessageBus.Dispatch.IMessageDispatcherThe message dispatcher to route messages to handlers.
serviceScopeFactoryMicrosoft.Extensions.DependencyInjection.IServiceScopeFactoryThe Dependency Injection container’s IServiceProvider instance, so that a “per-request” scope can be created that gives each MessageEnvelope
its own set of isolated dependencies.

.ctor Inherited

Inherited from object

Syntax

public Object()

Methods

Equals Inherited Virtual

Inherited from object

Syntax

public virtual bool Equals(object obj)

Parameters

NameTypeDescription
objobject?-

Returns

Type: bool

Equals Inherited

Inherited from object

Syntax

public static bool Equals(object objA, object objB)

Parameters

NameTypeDescription
objAobject?-
objBobject?-

Returns

Type: bool

GetHashCode Inherited Virtual

Inherited from object

Syntax

public virtual int GetHashCode()

Returns

Type: int

GetType Inherited

Inherited from object

Syntax

public System.Type GetType()

Returns

Type: System.Type

MemberwiseClone Inherited

Inherited from object

Syntax

protected internal object MemberwiseClone()

Returns

Type: object

ProcessQueue

Processes a message file when it appears in the queue directory.

Syntax

public System.Threading.Tasks.Task ProcessQueue(string messageEnvelopeJson, System.IO.FileSystemEventArgs fileTrigger, Microsoft.Extensions.Logging.ILogger logger)

Parameters

NameTypeDescription
messageEnvelopeJsonstringThe JSON content of the message envelope file.
fileTriggerSystem.IO.FileSystemEventArgsThe file system event that triggered this processing.
loggerMicrosoft.Extensions.Logging.ILoggerThe 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.

ReferenceEquals Inherited

Inherited from object

Syntax

public static bool ReferenceEquals(object objA, object objB)

Parameters

NameTypeDescription
objAobject?-
objBobject?-

Returns

Type: bool

ToString Inherited Virtual

Inherited from object

Syntax

public virtual string ToString()

Returns

Type: string?
  • CloudNimble.SimpleMessageBus.Dispatch.IQueueProcessor