fix(nats): use explicit subject prefixes — WorkQueue retention disallows > wildcard
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 9m9s
test / unit (pull_request) Successful in 16m19s
test / integration (pull_request) Failing after 17m5s

This commit is contained in:
2026-05-14 17:20:21 +02:00
parent 44385adb6b
commit 12adddaa16

View File

@@ -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;