Commit 4b33d58
committed
Fix NATS retry and DLQ routing
Three bugs prevented messages from retrying and reaching the DLQ:
1. Missing parkForRetry override: default nack() replays original payload
bytes so failureCount embedded in RqueueMessage never accumulated across
deliveries. Override acks the original and re-publishes the updated message
(with incremented failureCount). Nats-Msg-Id is suffixed with the failure
count to bypass the stream deduplication window.
2. Missing moveToDlq override: default re-enqueued to the source queue.
Override acks the original and publishes to the targetQueue's NATS stream
and subject (streamPrefix+targetQueue / subjectPrefix+targetQueue), the
same naming convention used for every other queue.
3. autoCreateDlqStream defaulted to true; changed to false so advisory-bridge
DLQ streams are opt-in rather than created automatically for every queue.
Assisted-By: Claude Code1 parent d0d72a7 commit 4b33d58
22 files changed
Lines changed: 596 additions & 340 deletions
File tree
- rqueue-core/src/main/java/com/github/sonus21/rqueue/core/spi
- rqueue-nats/src
- main/java/com/github/sonus21/rqueue/nats
- dao
- internal
- js
- kv
- lock
- repository
- service
- worker
- test/java/com/github/sonus21/rqueue/nats
- rqueue-spring-boot-starter/src/main/java/com/github/sonus21/rqueue/spring/boot
- rqueue-web/src/main
- java/com/github/sonus21/rqueue/web/service
- impl
- resources/templates/rqueue
Lines changed: 32 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
147 | 147 | | |
148 | 148 | | |
149 | 149 | | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
150 | 182 | | |
151 | 183 | | |
152 | 184 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | | - | |
| 36 | + | |
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| |||
Lines changed: 10 additions & 48 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
16 | 17 | | |
17 | | - | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
21 | | - | |
22 | 20 | | |
23 | | - | |
24 | 21 | | |
25 | 22 | | |
26 | 23 | | |
| |||
31 | 28 | | |
32 | 29 | | |
33 | 30 | | |
34 | | - | |
35 | 31 | | |
36 | 32 | | |
37 | 33 | | |
| |||
56 | 52 | | |
57 | 53 | | |
58 | 54 | | |
59 | | - | |
60 | | - | |
61 | | - | |
| 55 | + | |
62 | 56 | | |
63 | | - | |
64 | | - | |
65 | | - | |
| 57 | + | |
| 58 | + | |
66 | 59 | | |
67 | 60 | | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
| 61 | + | |
| 62 | + | |
97 | 63 | | |
98 | 64 | | |
99 | 65 | | |
| |||
104 | 70 | | |
105 | 71 | | |
106 | 72 | | |
107 | | - | |
108 | | - | |
| 73 | + | |
109 | 74 | | |
110 | 75 | | |
111 | 76 | | |
| |||
147 | 112 | | |
148 | 113 | | |
149 | 114 | | |
150 | | - | |
151 | | - | |
| 115 | + | |
152 | 116 | | |
153 | 117 | | |
154 | 118 | | |
| |||
158 | 122 | | |
159 | 123 | | |
160 | 124 | | |
161 | | - | |
162 | | - | |
| 125 | + | |
163 | 126 | | |
164 | 127 | | |
165 | 128 | | |
| |||
172 | 135 | | |
173 | 136 | | |
174 | 137 | | |
175 | | - | |
176 | | - | |
| 138 | + | |
177 | 139 | | |
178 | 140 | | |
179 | 141 | | |
| |||
Lines changed: 99 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
9 | 14 | | |
10 | 15 | | |
11 | 16 | | |
12 | 17 | | |
13 | 18 | | |
14 | 19 | | |
15 | 20 | | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
16 | 32 | | |
17 | | - | |
18 | 33 | | |
| 34 | + | |
| 35 | + | |
19 | 36 | | |
| 37 | + | |
20 | 38 | | |
21 | 39 | | |
22 | 40 | | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
28 | 47 | | |
29 | | - | |
30 | | - | |
31 | | - | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
32 | 51 | | |
33 | 52 | | |
34 | 53 | | |
| 54 | + | |
35 | 55 | | |
36 | 56 | | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
37 | 70 | | |
38 | 71 | | |
39 | | - | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
40 | 85 | | |
41 | 86 | | |
42 | 87 | | |
43 | 88 | | |
44 | | - | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
45 | 97 | | |
46 | 98 | | |
47 | 99 | | |
48 | 100 | | |
49 | | - | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
50 | 137 | | |
51 | 138 | | |
0 commit comments