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
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:
@@ -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) => {
|
||||
|
||||
Reference in New Issue
Block a user