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;