File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
src/test/java/com/arpnetworking/metrics/mad/sources/integration Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change 64
64
import java .util .concurrent .ExecutionException ;
65
65
import java .util .concurrent .TimeUnit ;
66
66
import java .util .concurrent .TimeoutException ;
67
+ import java .util .concurrent .atomic .AtomicInteger ;
67
68
import java .util .stream .Collectors ;
68
69
69
70
/**
@@ -80,6 +81,7 @@ public class KafkaSourceIT {
80
81
private static final Duration POLL_DURATION = Duration .ofSeconds (1 );
81
82
private static final int TIMEOUT = 10000 ;
82
83
private static final int NUM_RECORDS = 500 ;
84
+ private static final AtomicInteger RECORD_ID = new AtomicInteger (0 );
83
85
84
86
private Map <String , Object > _consumerProps ;
85
87
private KafkaConsumer <Integer , String > _consumer ;
@@ -268,7 +270,8 @@ private static void createTopic(final String topicName) throws TimeoutException
268
270
private static List <ProducerRecord <Integer , String >> createProducerRecords (final String topic , final int num ) {
269
271
final List <ProducerRecord <Integer , String >> records = new ArrayList <>();
270
272
for (int i = 0 ; i < num ; i ++) {
271
- records .add (new ProducerRecord <>(topic , i , "value" + i ));
273
+ final int id = RECORD_ID .getAndIncrement ();
274
+ records .add (new ProducerRecord <>(topic , id , "value" + id ));
272
275
}
273
276
return records ;
274
277
}
You can’t perform that action at this time.
0 commit comments