This repository was archived by the owner on Nov 10, 2025. It is now read-only.
Commit d7a2dd5
committed
Fix KinesisMDChA rewindIteratorOnError() for NPE
The error in the `KinesisMessageDrivenChannelAdapter.ShardConsumer.processTask()`
might be also thrown just direct from the `amazonKinesis.getRecords(getRecordsRequest)`.
If it happens first time, the `ShardCheckpointer` is not initialized with sequence numbers.
Therefore, a condition `highestSequence.equals(lastCheckpoint)` may lead to NPE.
* Rework the logic in the `KinesisMessageDrivenChannelAdapter.ShardConsumer.rewindIteratorOnError()`
to deal with a `null` for `this.checkpointer.getHighestSequence()` and reuse the current `shardIterator`
in the next request if no any commits happened.
* Remove `ShardCheckpointer.firstSequenceInBatch` since this is exactly a meaning of `shardIterator` representation.
Related to: #2231 parent bfde46a commit d7a2dd5
File tree
2 files changed
+28
-34
lines changed- src/main/java/org/springframework/integration/aws/inbound/kinesis
2 files changed
+28
-34
lines changedLines changed: 27 additions & 23 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
68 | | - | |
69 | 68 | | |
70 | 69 | | |
71 | 70 | | |
| |||
1146 | 1145 | | |
1147 | 1146 | | |
1148 | 1147 | | |
1149 | | - | |
1150 | 1148 | | |
1151 | 1149 | | |
1152 | | - | |
| 1150 | + | |
| 1151 | + | |
| 1152 | + | |
| 1153 | + | |
| 1154 | + | |
| 1155 | + | |
| 1156 | + | |
1153 | 1157 | | |
1154 | 1158 | | |
1155 | 1159 | | |
1156 | | - | |
1157 | 1160 | | |
1158 | | - | |
1159 | | - | |
1160 | | - | |
| 1161 | + | |
| 1162 | + | |
| 1163 | + | |
| 1164 | + | |
| 1165 | + | |
| 1166 | + | |
1161 | 1167 | | |
1162 | 1168 | | |
1163 | | - | |
1164 | | - | |
1165 | | - | |
1166 | | - | |
1167 | | - | |
1168 | | - | |
1169 | | - | |
1170 | | - | |
| 1169 | + | |
| 1170 | + | |
1171 | 1171 | | |
1172 | | - | |
1173 | | - | |
1174 | | - | |
1175 | | - | |
1176 | | - | |
1177 | | - | |
1178 | | - | |
| 1172 | + | |
| 1173 | + | |
| 1174 | + | |
| 1175 | + | |
| 1176 | + | |
| 1177 | + | |
| 1178 | + | |
| 1179 | + | |
| 1180 | + | |
| 1181 | + | |
| 1182 | + | |
| 1183 | + | |
1179 | 1184 | | |
1180 | 1185 | | |
1181 | 1186 | | |
| |||
1235 | 1240 | | |
1236 | 1241 | | |
1237 | 1242 | | |
1238 | | - | |
1239 | 1243 | | |
1240 | 1244 | | |
1241 | 1245 | | |
| |||
Lines changed: 1 addition & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | | - | |
47 | | - | |
48 | 46 | | |
49 | 47 | | |
50 | 48 | | |
| |||
88 | 86 | | |
89 | 87 | | |
90 | 88 | | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | 89 | | |
101 | 90 | | |
102 | 91 | | |
103 | 92 | | |
| 93 | + | |
104 | 94 | | |
105 | 95 | | |
106 | 96 | | |
| |||
0 commit comments