Class RemoteFileConsumer<TOptions>

Assembly: redb.Route.GenericFile.dll

Base class for remote file consumers (SFTP, FTP). Extends
with connection lifecycle management: auto-connect before poll, reconnect on failure,
disconnect after poll if configured, and remote-specific features (MaxAge, MoveFailed, SendEmptyMessageWhenIdle).

public abstract class RemoteFileConsumer<TOptions> : GenericFileConsumer<TOptions>, IConsumer where TOptions : RemoteFileEndpointOptions

Inheritance

Object→DrainableConsumer→GenericFileConsumer<TOptions>→RemoteFileConsumer<TOptions>

Implements

Inherited Members

Properties

RemoteOperations

Remote file operations with connection lifecycle.

protected IRemoteFileOperations RemoteOperations { get; }

Methods

AfterPollAsync(List<GenericFileInfo>, CancellationToken)

Disconnects from the remote server if the Disconnect option is set.

protected override Task AfterPollAsync(List<GenericFileInfo> files, CancellationToken ct)

BeforePollAsync(CancellationToken)

Connects to the remote server and validates the starting directory if required.

protected override Task BeforePollAsync(CancellationToken ct)

CheckMaxAge(GenericFileInfo)

Checks maximum file age based on .

protected override bool CheckMaxAge(GenericFileInfo file)

DisconnectClient()

Safely disconnects from the remote server.

protected void DisconnectClient()

EnsureConnectedAsync(CancellationToken)

Ensures a connection is active, reconnecting with retry if necessary.

protected Task EnsureConnectedAsync(CancellationToken ct)

OnNoFilesFoundAsync(CancellationToken)

Sends an empty exchange when idle if is set.

protected override Task OnNoFilesFoundAsync(CancellationToken ct)

OnPollError(Exception)

Disconnects from the remote server on poll error to force a fresh connection on next poll.

protected override void OnPollError(Exception ex)

OnProcessingFailedAsync(GenericFileInfo, string, CancellationToken)

Moves the file to the MoveFailed directory if configured.

protected override Task OnProcessingFailedAsync(GenericFileInfo file, string workPath, CancellationToken ct)

OnProcessingFailedAsync(string, string, string, CancellationToken)

The compatibility form of . A

protected override Task OnProcessingFailedAsync(string filePath, string fileName, string basePath, CancellationToken ct)

OnStopped()

Called at the end of Stop() after CTS disposal. Override for resource cleanup.

protected override Task OnStopped()

Constructors