Nuuvify.CommonPack.MftMailbox.Http 2.6.0-test.26070804

This is a prerelease version of Nuuvify.CommonPack.MftMailbox.Http.
dotnet add package Nuuvify.CommonPack.MftMailbox.Http --version 2.6.0-test.26070804
                    
NuGet\Install-Package Nuuvify.CommonPack.MftMailbox.Http -Version 2.6.0-test.26070804
                    
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.Http" Version="2.6.0-test.26070804" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Nuuvify.CommonPack.MftMailbox.Http" Version="2.6.0-test.26070804" />
                    
Directory.Packages.props
<PackageReference Include="Nuuvify.CommonPack.MftMailbox.Http" />
                    
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.Http --version 2.6.0-test.26070804
                    
#r "nuget: Nuuvify.CommonPack.MftMailbox.Http, 2.6.0-test.26070804"
                    
#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.Http@2.6.0-test.26070804
                    
#: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.Http&version=2.6.0-test.26070804&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Nuuvify.CommonPack.MftMailbox.Http&version=2.6.0-test.26070804&prerelease
                    
Install as a Cake Tool

Nuuvify.CommonPack.MftMailbox.Http

PR Validation Publish and Release NuGet Downloads

Adapter HTTPS Mailbox para integração MFT com suporte a:

  • upload/download por streaming
  • polling de status com backoff
  • confirmação ACK/NACK por API
  • tratamento resiliente para falhas transientes

Índice

Quando usar

  • Quando o provedor MFT expõe Mailbox via API HTTPS.
  • Quando o fluxo exige status assíncrono com polling controlado.
  • Quando ACK/NACK é confirmado por endpoint HTTP.

Dependências

  • Nuuvify.CommonPack.MftMailbox
  • Nuuvify.CommonPack.MftMailbox.Abstraction
  • Microsoft.Extensions.Http

Instalação

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

Configuração

HttpMftMailboxOptions

  • BaseUrl
  • UploadPath
  • DownloadPath
  • ListPath
  • StatusPath
  • AckNackPath
  • BearerToken
  • UseMutualTls
  • StatusPollingMaxAttempts
  • StatusPollingBaseDelay

Registro no DI

using Nuuvify.CommonPack.MftMailbox;
using Nuuvify.CommonPack.MftMailbox.Http;

builder.Services.AddMftMailboxCore();

builder.Services.AddMftMailboxHttp(options =>
{
	options.BaseUrl = "https://mft.example.com";
	options.UploadPath = "/mailbox/upload";
	options.DownloadPath = "/mailbox/download";
	options.ListPath = "/mailbox/list";
	options.StatusPath = "/mailbox/status";
	options.AckNackPath = "/mailbox/acknack";
	options.BearerToken = "token-via-secret-provider";
	options.StatusPollingMaxAttempts = 10;
	options.StatusPollingBaseDelay = TimeSpan.FromSeconds(2);
});

Exemplo de envio

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

public sealed class HttpOutboundService
{
	private readonly IMftClientFactory _factory;

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

	public async Task<TransferItemResult> SendAsync(Stream payload, CancellationToken ct)
	{
		var client = _factory.CreateTransferClient(MftProtocol.Https);

		var envelope = new TransferEnvelope
		{
			IntegrationKey = "erp-http",
			CorrelationId = Guid.NewGuid().ToString("N"),
			Protocol = MftProtocol.Https,
			Items = new List<TransferItem>
			{
				new()
				{
					ItemId = Guid.NewGuid().ToString("N"),
					FileName = "orders.json",
					ContentFactory = _ => Task.FromResult(payload)
				}
			}
		};

		return await client.SendSingleAsync(envelope, ct);
	}
}

Exemplo de status

var statusClient = _factory.CreateStatusClient(MftProtocol.Https);
var status = await statusClient.GetStatusAsync("erp-http", "item-01", ct);

Exemplo de ACK/NACK

var ackClient = _factory.CreateAckNackClient(MftProtocol.Https);

await ackClient.AckOrNackAsync(new AckNackCommand
{
	IntegrationKey = "erp-http",
	CorrelationId = Guid.NewGuid().ToString("N"),
	ItemId = "item-01",
	FileName = "orders.json",
	Protocol = MftProtocol.Https,
	Decision = AckNackType.Nack,
	Reason = "checksum mismatch"
}, ct);

Segurança

  • Use BearerToken obtido de secret manager.
  • Se necessário, habilite mTLS na infraestrutura HTTP.
  • Não registre payload sensível em logs.
  • Restrinja permissões e escopo do token por integração.

Troubleshooting

  • 401/403: validar token, escopo e relógio do ambiente.
  • Timeout: revisar BaseUrl, proxy, timeout e políticas de retry.
  • Polling sem conclusão: ajustar StatusPollingMaxAttempts/base delay e validar endpoint de status.
  • Falha de desserialização: validar contrato de resposta do provedor MFT.
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.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.6.0-test.26070804 0 7/8/2026

# Changelog - Nuuvify.CommonPack.MftMailbox.Http

Todas as mudancas notaveis deste pacote serao documentadas neste arquivo.

O formato e 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).

## [Nao Lancado]

### Adicionado
- Adapter HTTPS Mailbox com envio/recebimento streaming, status e ACK/NACK.

### Alterado

### Corrigido

### Removido

### Seguranca