feat: expose RabbitMQ delivery context

Add backward-compatible context-aware handling and permanent validation hooks.

Ref: IT-1033
This commit is contained in:
2026-08-02 22:56:57 +03:00
parent 09c4b8b4d2
commit c0e83bdb77
4 changed files with 264 additions and 6 deletions
+23
View File
@@ -0,0 +1,23 @@
namespace Hrynco.RabbitMq;
using System.Collections.Generic;
/// <summary>
/// Transport metadata supplied by RabbitMQ for a delivered message.
/// Application-specific consumers can use this context for validation,
/// correlation, and diagnostics without taking ownership of acknowledgements.
/// </summary>
public sealed record RabbitMqMessageContext
{
public required string QueueName { get; init; }
public required string Exchange { get; init; }
public required string RoutingKey { get; init; }
public string? MessageId { get; init; }
public string? MessageType { get; init; }
public string? CorrelationId { get; init; }
public string? ReplyTo { get; init; }
public string? ContentType { get; init; }
public bool Redelivered { get; init; }
public IReadOnlyDictionary<string, object?> Headers { get; init; }
= new Dictionary<string, object?>();
}