counter: 1.1.8 - Fixed a `ConcurentModificationException`-bug counter-1.1.8
authorKai Moritz <kai@juplo.de>
Sat, 11 Feb 2023 13:27:15 +0000 (14:27 +0100)
committerKai Moritz <kai@juplo.de>
Fri, 17 Feb 2023 16:32:20 +0000 (17:32 +0100)
pom.xml
src/test/java/de/juplo/kafka/wordcount/counter/CounterApplicationIT.java

diff --git a/pom.xml b/pom.xml
index 87f1f77..93a541b 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -10,7 +10,7 @@
        </parent>
        <groupId>de.juplo.kafka.wordcount</groupId>
        <artifactId>counter</artifactId>
-       <version>1.1.7</version>
+       <version>1.1.8</version>
        <name>Wordcount-Counter</name>
        <description>Word-counting stream-processor of the multi-user wordcount-example</description>
        <properties>
index c6eb0a6..b412fe4 100644 (file)
@@ -60,7 +60,7 @@ public class CounterApplicationIT
 
                await("Expexted converted data")
                                .atMost(Duration.ofSeconds(10))
-                               .untilAsserted(() -> TestData.assertExpectedResult(consumer.received));
+                               .untilAsserted(() -> TestData.assertExpectedResult(consumer.getReceivedMessages()));
        }
 
 
@@ -70,11 +70,16 @@ public class CounterApplicationIT
                private final List<Message> received = new LinkedList<>();
 
                @KafkaListener(groupId = "TEST", topics = TOPIC_OUT)
-               public void receive(ConsumerRecord<String, String> record)
+               public synchronized void receive(ConsumerRecord<String, String> record)
                {
                        log.debug("Received message: {}", record);
                        received.add(Message.of(record.key(),record.value()));
                }
+
+               synchronized List<Message> getReceivedMessages()
+               {
+                       return received;
+               }
        }
 
        @TestConfiguration