-
Notifications
You must be signed in to change notification settings - Fork 15.4k
KAFKA-9798: Send one round synchronously before starting the async producer #8565
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 4 commits
6f34ba8
afb19b2
ca635d2
3f3aaa3
5c20eed
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -204,11 +204,11 @@ public void before() throws Exception { | |
|
|
||
| streamsConfiguration.put(StreamsConfig.APPLICATION_ID_CONFIG, applicationId); | ||
| streamsConfiguration.put(StreamsConfig.BOOTSTRAP_SERVERS_CONFIG, CLUSTER.bootstrapServers()); | ||
| streamsConfiguration.put(ConsumerConfig.AUTO_OFFSET_RESET_CONFIG, "earliest"); | ||
| streamsConfiguration.put(StreamsConfig.STATE_DIR_CONFIG, TestUtils.tempDirectory("state-" + applicationId).getPath()); | ||
| streamsConfiguration.put(StreamsConfig.DEFAULT_KEY_SERDE_CLASS_CONFIG, Serdes.String().getClass()); | ||
| streamsConfiguration.put(StreamsConfig.DEFAULT_VALUE_SERDE_CLASS_CONFIG, Serdes.String().getClass()); | ||
| streamsConfiguration.put(StreamsConfig.COMMIT_INTERVAL_MS_CONFIG, 100); | ||
| streamsConfiguration.put(ConsumerConfig.AUTO_OFFSET_RESET_CONFIG, "earliest"); | ||
|
|
||
| stringComparator = Comparator.comparing((KeyValue<String, String> o) -> o.key).thenComparing(o -> o.value); | ||
| stringLongComparator = Comparator.comparing((KeyValue<String, Long> o) -> o.key).thenComparingLong(o -> o.value); | ||
|
|
@@ -631,7 +631,11 @@ public void shouldAllowConcurrentAccesses() throws Exception { | |
| final String storeName = "word-count-store"; | ||
| final String windowStoreName = "windowed-word-count-store"; | ||
|
|
||
| final ProducerRunnable producerRunnable = new ProducerRunnable(streamConcurrent, inputValues, numIterations); | ||
| // send one round of records first to populate the stores | ||
| ProducerRunnable producerRunnable = new ProducerRunnable(streamThree, inputValues, 1); | ||
| producerRunnable.run(); | ||
|
|
||
| producerRunnable = new ProducerRunnable(streamConcurrent, inputValues, numIterations); | ||
| final Thread producerThread = new Thread(producerRunnable); | ||
| kafkaStreams = createCountStream( | ||
| streamConcurrent, | ||
|
|
@@ -1262,6 +1266,7 @@ public void run() { | |
| } | ||
| incrementIteration(); | ||
| } | ||
| producer.flush(); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The producer is create using try-with-resource clause thus, the producer should be flushed on the implicit
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Makes sense, will fix. |
||
| } | ||
| } | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be
numIterations - 1