Commit aae9b8f
committed
Introduce
The 4.0 boolean `explicitShareAcknowledgment` only controlled whether
the listener received a non-null acknowledgment object. It had no
effect on Kafka's `share.acknowledgement.mode`, so `acknowledge()`
would throw `IllegalStateException` when the factory used the Kafka
default (implicit mode).
`ContainerProperties.ShareAckMode` (EXPLICIT, MANUAL, IMPLICIT) makes
the modes explicit, with EXPLICIT as the default — the same philosophy
as regular containers disabling auto.commit and owning the commit
lifecycle themselves. For EXPLICIT and MANUAL the container now
enforces `share.acknowledgement.mode=explicit` via consumer override
properties, regardless of factory configuration.
Other related fixes:
- `RecordDeserializationException` handler now guards `acknowledge()`
against IMPLICIT mode
- `createShareConsumer` variant added to `ShareConsumerFactory` for
consumer-level overrides
- 4.0 dead code and naming issues cleaned up
Deprecated methods keep the 4.0 API intact.
Reference docs and What's New include a migration guide.
Adding tests to verify the changes.
Signed-off-by: Soby Chacko <soby.chacko@broadcom.com>ShareAckMode enum for share consumers1 parent 30d242b commit aae9b8f
File tree
12 files changed
+714
-385
lines changed- spring-kafka-docs/src/main/antora/modules/ROOT/pages
- kafka
- spring-kafka/src
- main/java/org/springframework/kafka
- config
- core
- listener
- support
- test/java/org/springframework/kafka/listener
12 files changed
+714
-385
lines changedLines changed: 179 additions & 132 deletions
Large diffs are not rendered by default.
Lines changed: 57 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
17 | 74 | | |
18 | 75 | | |
19 | 76 | | |
| |||
Lines changed: 0 additions & 40 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
24 | | - | |
25 | 23 | | |
26 | 24 | | |
27 | 25 | | |
| |||
183 | 181 | | |
184 | 182 | | |
185 | 183 | | |
186 | | - | |
187 | | - | |
188 | | - | |
189 | | - | |
190 | | - | |
191 | 184 | | |
192 | 185 | | |
193 | 186 | | |
| |||
208 | 201 | | |
209 | 202 | | |
210 | 203 | | |
211 | | - | |
212 | | - | |
213 | | - | |
214 | | - | |
215 | | - | |
216 | | - | |
217 | | - | |
218 | | - | |
219 | | - | |
220 | | - | |
221 | | - | |
222 | | - | |
223 | | - | |
224 | | - | |
225 | | - | |
226 | | - | |
227 | | - | |
228 | | - | |
229 | | - | |
230 | | - | |
231 | | - | |
232 | | - | |
233 | | - | |
234 | | - | |
235 | | - | |
236 | | - | |
237 | | - | |
238 | | - | |
239 | | - | |
240 | | - | |
241 | | - | |
242 | | - | |
243 | | - | |
244 | 204 | | |
245 | 205 | | |
246 | 206 | | |
| |||
Lines changed: 28 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| 29 | + | |
29 | 30 | | |
30 | 31 | | |
31 | 32 | | |
| |||
141 | 142 | | |
142 | 143 | | |
143 | 144 | | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
144 | 151 | | |
145 | | - | |
| 152 | + | |
| 153 | + | |
146 | 154 | | |
147 | | - | |
| 155 | + | |
148 | 156 | | |
149 | 157 | | |
150 | 158 | | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
151 | 174 | | |
| 175 | + | |
152 | 176 | | |
153 | | - | |
| 177 | + | |
154 | 178 | | |
155 | 179 | | |
156 | | - | |
| 180 | + | |
157 | 181 | | |
158 | 182 | | |
159 | 183 | | |
| |||
Lines changed: 19 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
46 | 65 | | |
47 | 66 | | |
48 | 67 | | |
| |||
Lines changed: 14 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
| 30 | + | |
31 | 31 | | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
36 | 39 | | |
37 | 40 | | |
38 | 41 | | |
39 | | - | |
| 42 | + | |
| 43 | + | |
40 | 44 | | |
41 | 45 | | |
42 | 46 | | |
| |||
52 | 56 | | |
53 | 57 | | |
54 | 58 | | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
59 | 62 | | |
60 | | - | |
| 63 | + | |
61 | 64 | | |
62 | 65 | | |
63 | 66 | | |
| |||
Lines changed: 70 additions & 21 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | | - | |
39 | 38 | | |
40 | 39 | | |
41 | 40 | | |
| |||
117 | 116 | | |
118 | 117 | | |
119 | 118 | | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
120 | 153 | | |
121 | 154 | | |
122 | 155 | | |
| |||
314 | 347 | | |
315 | 348 | | |
316 | 349 | | |
317 | | - | |
| 350 | + | |
318 | 351 | | |
319 | 352 | | |
320 | 353 | | |
| |||
1121 | 1154 | | |
1122 | 1155 | | |
1123 | 1156 | | |
1124 | | - | |
| 1157 | + | |
1125 | 1158 | | |
1126 | 1159 | | |
1127 | 1160 | | |
1128 | | - | |
1129 | | - | |
1130 | | - | |
1131 | | - | |
1132 | | - | |
1133 | | - | |
1134 | | - | |
1135 | | - | |
1136 | | - | |
| 1161 | + | |
| 1162 | + | |
| 1163 | + | |
| 1164 | + | |
| 1165 | + | |
| 1166 | + | |
| 1167 | + | |
| 1168 | + | |
| 1169 | + | |
| 1170 | + | |
| 1171 | + | |
| 1172 | + | |
| 1173 | + | |
| 1174 | + | |
| 1175 | + | |
| 1176 | + | |
| 1177 | + | |
| 1178 | + | |
| 1179 | + | |
| 1180 | + | |
| 1181 | + | |
| 1182 | + | |
| 1183 | + | |
1137 | 1184 | | |
| 1185 | + | |
1138 | 1186 | | |
1139 | | - | |
| 1187 | + | |
1140 | 1188 | | |
1141 | 1189 | | |
1142 | 1190 | | |
1143 | | - | |
1144 | | - | |
| 1191 | + | |
| 1192 | + | |
| 1193 | + | |
1145 | 1194 | | |
| 1195 | + | |
1146 | 1196 | | |
1147 | | - | |
| 1197 | + | |
1148 | 1198 | | |
1149 | 1199 | | |
1150 | 1200 | | |
1151 | | - | |
| 1201 | + | |
1152 | 1202 | | |
1153 | | - | |
1154 | | - | |
1155 | | - | |
| 1203 | + | |
| 1204 | + | |
1156 | 1205 | | |
1157 | 1206 | | |
1158 | 1207 | | |
| |||
1163 | 1212 | | |
1164 | 1213 | | |
1165 | 1214 | | |
1166 | | - | |
| 1215 | + | |
1167 | 1216 | | |
1168 | 1217 | | |
1169 | 1218 | | |
| |||
0 commit comments