From 12adddaa163a26a25954b120471d238d052e891c Mon Sep 17 00:00:00 2001 From: Gabriel Kaszewski Date: Thu, 14 May 2026 17:20:21 +0200 Subject: [PATCH] =?UTF-8?q?fix(nats):=20use=20explicit=20subject=20prefixe?= =?UTF-8?q?s=20=E2=80=94=20WorkQueue=20retention=20disallows=20>=20wildcar?= =?UTF-8?q?d?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crates/adapters/nats/src/lib.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/crates/adapters/nats/src/lib.rs b/crates/adapters/nats/src/lib.rs index f240d87..ae3fb26 100644 --- a/crates/adapters/nats/src/lib.rs +++ b/crates/adapters/nats/src/lib.rs @@ -7,7 +7,9 @@ use std::sync::Arc; // Stream name and subjects used by both publisher and consumer. const STREAM_NAME: &str = "THOUGHTS_EVENTS"; -const STREAM_SUBJECTS: &[&str] = &[">"]; +// Explicit prefixes instead of ">" — NATS WorkQueue retention disallows +// the catch-all ">" wildcard without also setting no_ack = true. +const STREAM_SUBJECTS: &[&str] = &["thoughts.>", "likes.>", "boosts.>", "follows.>", "users.>"]; const CONSUMER_NAME: &str = "worker"; // Redelivery timeout: if a message is not acked within this time, NATS redelivers it. const ACK_WAIT_SECS: u64 = 30;