# Module: RabbitMQ stream sync (failsafe) ## Purpose **Annotation Sync** outbox and **RabbitMQ Stream** producer — `01_annotations.md` §Annotation Sync, Failsafe Queue, RabbitMQ Stream. ## Code - `RabbitMqConfig` + `FailsafeProducer` (`Services/FailsafeProducer.cs`) — `BackgroundService`; builds `StreamSystem`, drains `annotations_queue_records`, serializes **MessagePack** payloads (`AnnotationQueueMessage`, `AnnotationBulkQueueMessage` in `DTOs/QueueMessages.cs`), gzip as implemented. - Entity `AnnotationsQueueRecord` — see `database-layer.md`. ## Dependencies `AppDataConnection`, `PathResolver` (for image bytes on create), env-driven `RABBITMQ_*` from `Program`. ## Consumers (downstream, external) Admin `AnnotationSyncWorker`, AI Training consumer — described in suite doc. ## Suite doc Full sync topology and stream semantics in `01_annotations.md`; keep MessagePack key layout stable.