Nuuvify.CommonPack.MftMailbox 3.1.0

There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package Nuuvify.CommonPack.MftMailbox --version 3.1.0
                    
NuGet\Install-Package Nuuvify.CommonPack.MftMailbox -Version 3.1.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Nuuvify.CommonPack.MftMailbox" Version="3.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Nuuvify.CommonPack.MftMailbox" Version="3.1.0" />
                    
Directory.Packages.props
<PackageReference Include="Nuuvify.CommonPack.MftMailbox" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Nuuvify.CommonPack.MftMailbox --version 3.1.0
                    
#r "nuget: Nuuvify.CommonPack.MftMailbox, 3.1.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Nuuvify.CommonPack.MftMailbox@3.1.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Nuuvify.CommonPack.MftMailbox&version=3.1.0
                    
Install as a Cake Addin
#tool nuget:?package=Nuuvify.CommonPack.MftMailbox&version=3.1.0
                    
Install as a Cake Tool

Quality Gate Status

CI Release NuGet Downloads

Núcleo de orquestração para integração com MFT Mailbox, com foco em:

  • resolução de clientes por protocolo (factory)
  • idempotência
  • auditoria de transferência
  • utilitários de resiliência e checksum

Índice

Quando usar

  • Quando você quer padronizar o consumo de MFT entre múltiplos protocolos.
  • Quando o projeto precisa de uma camada única de factory, idempotência e auditoria.
  • Quando adapters SFTP/HTTPS devem ser plugáveis sem acoplamento no domínio.

Pacotes relacionados

  • Nuuvify.CommonPack.MftMailbox.Abstraction
  • Nuuvify.CommonPack.MftMailbox.Sftp
  • Nuuvify.CommonPack.MftMailbox.Http

Instalação

<PackageReference Include="Nuuvify.CommonPack.MftMailbox" Version="x.x.x" />

Configuração no DI

using Nuuvify.CommonPack.MftMailbox;

builder.Services.AddMftMailboxCore(options =>
{
	options.MaxBatchSize = 500;
	options.MaxFileSizeBytes = 1_073_741_824;
	options.MaxDegreeOfParallelism = 4;
	options.FileTimeout = TimeSpan.FromMinutes(5);
	options.BatchTimeout = TimeSpan.FromMinutes(30);

	options.Retry.MaxRetries = 3;
	options.Retry.BaseDelay = TimeSpan.FromSeconds(2);
	options.Retry.MaxDelay = TimeSpan.FromSeconds(30);

	options.CircuitBreaker.FailureThreshold = 5;
	options.CircuitBreaker.BreakDuration = TimeSpan.FromSeconds(60);
});

Configuração de opções

MftMailboxOptions

  • MaxBatchSize: limite de itens por lote.
  • MaxFileSizeBytes: limite por arquivo.
  • MaxDegreeOfParallelism: concorrência máxima sugerida.
  • FileTimeout: timeout por arquivo.
  • BatchTimeout: timeout por lote.
  • Retry: configuração de tentativas/transientes.
  • CircuitBreaker: proteção contra indisponibilidade externa.

Stores e sinks padrão

O pacote registra implementações padrão:

  • IMftIdempotencyStore → InMemoryMftIdempotencyStore
  • ITransferAuditSink → NullTransferAuditSink
  • IMftClientFactory → MftClientFactory

Você pode substituir por implementações próprias no seu projeto.

Exemplo de uso

using Nuuvify.CommonPack.MftMailbox.Abstraction.Interfaces;
using Nuuvify.CommonPack.MftMailbox.Abstraction.Models;

public sealed class MftStatusService
{
	private readonly IMftClientFactory _factory;

	public MftStatusService(IMftClientFactory factory)
	{
		_factory = factory;
	}

	public Task<TransferStatus?> GetAsync(string integrationKey, string itemId, CancellationToken ct)
	{
		var client = _factory.CreateStatusClient(MftProtocol.Https);
		return client.GetStatusAsync(integrationKey, itemId, ct);
	}
}

Componentes principais

  • MftMailboxSetup: extensão AddMftMailboxCore.
  • MftClientFactory: resolve implementação por MftProtocol.
  • InMemoryMftIdempotencyStore: referência para cenários simples e testes.
  • RetryExecutor, ResilienceGate, ChecksumCalculator, IdempotencyKeyBuilder.

Boas práticas em produção

  • Troque InMemoryMftIdempotencyStore por store persistente.
  • Troque NullTransferAuditSink por sink de observabilidade (log, fila ou banco).
  • Ajuste retry/circuit breaker por SLA da integração.
  • Defina limites de lote/arquivo compatíveis com throughput do ambiente.

Troubleshooting

Nenhum cliente de protocolo foi resolvido

Verifique se o protocolo específico foi registrado após o core:

builder.Services.AddMftMailboxCore();
builder.Services.AddMftMailboxSftp(/* ... */);
// ou
builder.Services.AddMftMailboxHttp(/* ... */);

Erros de idempotência em produção com múltiplas instâncias

A implementação padrão é em memória. Em cenários distribuídos, substitua por um store persistente:

  • Nuuvify.CommonPack.MftMailbox.Redis para Redis distribuído.
  • Implementação própria de IMftIdempotencyStore para outros backends.

Auditoria não está sendo registrada

O core registra NullTransferAuditSink por padrão. Substitua por um sink real:

builder.Services.AddSingleton<ITransferAuditSink, SeuAuditSink>();

Compatibilidade

  • Framework alvo: .NET 8
  • Dependência de abstração: Nuuvify.CommonPack.MftMailbox.Abstraction
Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (3)

Showing the top 3 NuGet packages that depend on Nuuvify.CommonPack.MftMailbox:

Package Downloads
Nuuvify.CommonPack.MftMailbox.Sftp

Adapter SFTP para envio, recebimento e ACK/NACK em MFT Mailbox.

Nuuvify.CommonPack.MftMailbox.Redis

Integração Redis para Nuuvify.CommonPack.MftMailbox com idempotência distribuída, cache de status compartilhado e auditoria via streams.

Nuuvify.CommonPack.MftMailbox.Http

Adapter HTTPS Mailbox para envio, recebimento, status e ACK/NACK.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
3.1.1-preview.140 45 11/25/2026
3.1.1-preview.138 51 11/25/2026
3.1.1-preview.132 55 11/25/2026
3.1.0 74 11/25/2026
3.0.1-preview.129 51 11/25/2026
3.0.1-preview.123 59 11/24/2026
3.0.1-preview.118 67 11/23/2026
3.0.1-preview.111 64 11/23/2026
3.0.1-preview.103 68 11/23/2026
3.0.1-preview.94 76 11/23/2026
3.0.0-preview.121 58 11/24/2026
2.10.1 223 10/24/2026
2.10.0 159 10/24/2026
2.9.1 173 10/24/2026
2.9.0 227 8/26/2026
2.9.0-preview.53 92 10/23/2026
2.9.0-preview.50 97 9/18/2026
2.9.0-preview.45 105 8/26/2026
2.9.0-preview.44 107 8/26/2026
2.9.0-preview.43 105 8/23/2026
Loading failed

# Changelog - Nuuvify.CommonPack.MftMailbox

Todas as mudanças notáveis deste pacote serão documentadas neste arquivo.

O formato é baseado em [Keep a Changelog](https://keepachangelog.com/pt-br/1.0.0/),
e este projeto adere ao [Semantic Versioning](https://semver.org/lang/pt-BR/spec/v2.0.0.html).

## [Não Lançado]

## [2.10.1] - 2026-10-24

### Alterado

- Dependências atualizadas na linha compatível com .NET 8: `Microsoft.Extensions.Logging.Abstractions` 8.0.3.

## [2.9.0] - 2026-08-26

### Adicionado
- Núcleo de MFT Mailbox com factory, idempotência e auditoria.

### Alterado
- Adicionada opção de ordenação de arquivos inbound para permitir escolha entre ordem original, nome crescente e nome decrescente.