feat(broker): add RabbitMQ + MassTransit job broker for cross-site analysis Mutualise les ressources IA/GPU entre sites via un broker de jobs durable. RabbitMQ + MassTransit avec connexion AMQP sortante (pas de port entrant). - Heimdall.Contracts: contrats de messages partagés - RabbitMQ: conteneur docker + credentials via env vars - MassTransit Central: publication de jobs d'analyse - MassTransit Agent: consommateur avec backpressure GPU Fixes #72
36 lines
1.4 KiB
C#
36 lines
1.4 KiB
C#
namespace Heimdall.Contracts;
|
|
|
|
/// <summary>
|
|
/// Message published by the Central to request an analysis job from an agent.
|
|
/// The agent consumes this message and runs the AI pipeline (YOLO/ONNX) on the
|
|
/// provided frame data, then publishes <see cref="AnalysisJobCompleted"/> or
|
|
/// <see cref="AnalysisJobFailed"/>.
|
|
/// </summary>
|
|
public sealed record AnalysisJobRequested
|
|
{
|
|
/// <summary>Unique identifier for this analysis job.</summary>
|
|
public Guid Id { get; init; } = Guid.NewGuid();
|
|
|
|
/// <summary>Identifier of the camera whose frame is to be analysed.</summary>
|
|
public required Guid CameraId { get; init; }
|
|
|
|
/// <summary>Identifier of the site the camera belongs to.</summary>
|
|
public required Guid SiteId { get; init; }
|
|
|
|
/// <summary>Identifier of the target agent that should run the analysis.</summary>
|
|
public required Guid AgentId { get; init; }
|
|
|
|
/// <summary>
|
|
/// Base64-encoded JPEG frame data to analyse.
|
|
/// Agents behind NAT receive the frame through AMQP rather than pulling it
|
|
/// via HTTPS — avoids requiring inbound connectivity to the Central.
|
|
/// </summary>
|
|
public required string FrameData { get; init; }
|
|
|
|
/// <summary>Optional metadata (model override, confidence threshold, etc.).</summary>
|
|
public Dictionary<string, string>? Metadata { get; init; }
|
|
|
|
/// <summary>Timestamp when the job was created (UTC).</summary>
|
|
public DateTime RequestedAtUtc { get; init; } = DateTime.UtcNow;
|
|
}
|