60
60
import org .springframework .kafka .config .KafkaListenerEndpointRegistry ;
61
61
import org .springframework .kafka .core .ConsumerFactory ;
62
62
import org .springframework .kafka .listener .ContainerProperties .AckMode ;
63
- import org .springframework .kafka .support .KafkaHeaders ;
64
63
import org .springframework .kafka .test .utils .KafkaTestUtils ;
65
- import org .springframework .messaging .handler .annotation .Header ;
66
64
import org .springframework .test .annotation .DirtiesContext ;
67
65
import org .springframework .test .context .junit .jupiter .SpringJUnitConfig ;
68
66
@@ -110,7 +108,6 @@ public void doesNotResumeIfPartitionPaused() throws Exception {
110
108
verify (this .consumer , never ()).resume (any ());
111
109
assertThat (this .config .count ).isEqualTo (4 );
112
110
assertThat (this .config .contents ).contains ("foo" , "bar" , "baz" , "qux" );
113
- assertThat (this .config .deliveries ).contains (1 , 1 , 1 , 1 );
114
111
verify (this .consumer , never ()).seek (any (), anyLong ());
115
112
}
116
113
@@ -120,8 +117,6 @@ public static class Config {
120
117
121
118
final List <String > contents = new ArrayList <>();
122
119
123
- final List <Integer > deliveries = new ArrayList <>();
124
-
125
120
final CountDownLatch pollLatch = new CountDownLatch (4 );
126
121
127
122
final CountDownLatch deliveryLatch = new CountDownLatch (4 );
@@ -135,9 +130,8 @@ public static class Config {
135
130
@ KafkaListener (id = "id" , groupId = "grp" ,
136
131
topicPartitions = @ org .springframework .kafka .annotation .TopicPartition (topic = "foo" ,
137
132
partitions = "#{'0,1,2'.split(',')}" ))
138
- public void foo (String in , @ Header ( KafkaHeaders . DELIVERY_ATTEMPT ) int delivery ) {
133
+ public void foo (String in ) {
139
134
this .contents .add (in );
140
- this .deliveries .add (delivery );
141
135
this .deliveryLatch .countDown ();
142
136
if (++this .count == 4 || this .count == 5 ) { // part 1, offset 1, first and second times
143
137
throw new RuntimeException ("foo" );
0 commit comments