feat(nats): migrate to JetStream — at-least-once delivery with durable consumer
Some checks failed
lint / lint (push) Has been cancelled
test / unit (push) Has been cancelled
test / integration (push) Has been cancelled
lint / lint (pull_request) Failing after 9m25s
test / unit (pull_request) Successful in 15m53s
test / integration (pull_request) Failing after 16m42s

This commit is contained in:
2026-05-14 16:41:17 +02:00
parent 550865bad4
commit 458feebcdd
4 changed files with 104 additions and 16 deletions

View File

@@ -44,6 +44,9 @@ pub async fn build(cfg: &Config) -> Infrastructure {
Some(url) => match async_nats::connect(url).await {
Ok(client) => {
tracing::info!("Connected to NATS at {url}");
if let Err(e) = nats::ensure_stream(&client).await {
tracing::warn!("JetStream stream setup failed: {e} — events may be lost");
}
Arc::new(EventPublisherAdapter::new(NatsTransport::new(client)))
}
Err(e) => {