Give a work-queue stream its one consumer, drop-only dead letters (issue 1178)
This commit is contained in:
@@ -36,3 +36,21 @@ func TestANonWorkQueueStreamStillDropsItsOldest(t *testing.T) {
|
||||
t.Fatalf("composed as %+v; want limits retention, never discarding new, no duplicate window", s)
|
||||
}
|
||||
}
|
||||
|
||||
// 1178/AC1: the process a work-queue stream's bus.queues names gets exactly one durable consumer,
|
||||
// <node>_<module>_<process id>, with the stream's declared max-deliver — composed even though mesh-mail's
|
||||
// sender otherwise consumes and watches nothing of its own, which alone would give ConsumerFor nothing
|
||||
// needed. Explicit acknowledgement is EnsureConsumer's own rule for every consumer it makes (jetstream.go),
|
||||
// so it is not re-asserted here.
|
||||
func TestTheOneProcessAWorkQueuesBusNamesGetsItsOwnConsumer(t *testing.T) {
|
||||
sender := Principal{Kind: KindModule, Node: "novox", Module: "mesh-mail", PasswordHash: "x",
|
||||
Queues: []QueueOwner{{Process: "send", Stream: "MAIL_SENDS", MaxDeliver: 5}}}
|
||||
got := ConsumersOf([]Principal{sender})
|
||||
if len(got) != 1 {
|
||||
t.Fatalf("mesh-mail's consumers: %+v", got)
|
||||
}
|
||||
c := got[0].Consumer
|
||||
if c.Name != "novox_mesh-mail_send" || c.Stream != "MAIL_SENDS" || c.MaxDeliver != 5 {
|
||||
t.Fatalf("the queue's consumer: %+v", c)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user