Merge der überarbeiteten Compose-Konfiguration ('rebalance-listener')
authorKai Moritz <kai@juplo.de>
Sat, 23 Jul 2022 13:41:57 +0000 (15:41 +0200)
committerKai Moritz <kai@juplo.de>
Sat, 23 Jul 2022 13:48:48 +0000 (15:48 +0200)
* Dabei auch die letzten Verbesserungen aus 'rebalance-listener' übernommen.

1  2 
docker-compose.yml
pom.xml
src/main/java/de/juplo/kafka/Application.java
src/main/java/de/juplo/kafka/EndlessConsumer.java
src/main/resources/application.yml

@@@ -67,10 -51,10 +68,11 @@@ services
    consumer:
      image: juplo/endless-consumer:1.0-SNAPSHOT
      ports:
-       - 8081:8081
+       - 8081:8080
      environment:
+       server.port: 8080
        consumer.bootstrap-server: kafka:9092
 -      consumer.client-id: my-group
        consumer.client-id: consumer
        consumer.topic: test
 +      spring.data.mongodb.uri: mongodb://juplo:training@mongo:27017
 +      spring.data.mongodb.database: juplo
diff --cc pom.xml
+++ b/pom.xml
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-web</artifactId>
      </dependency>
 +    <dependency>
 +      <groupId>org.springframework.boot</groupId>
 +      <artifactId>spring-boot-starter-data-mongodb</artifactId>
 +    </dependency>
+     <dependency>
+       <groupId>org.springframework.boot</groupId>
+       <artifactId>spring-boot-starter-validation</artifactId>
+     </dependency>
      <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-actuator</artifactId>
@@@ -19,13 -18,8 +18,8 @@@ public class Applicatio
  
  
    @Bean
 -  public EndlessConsumer consumer()
 +  public EndlessConsumer consumer(PartitionStatisticsRepository repository)
    {
-     Assert.hasText(properties.getBootstrapServer(), "consumer.bootstrap-server must be set");
-     Assert.hasText(properties.getGroupId(), "consumer.group-id must be set");
-     Assert.hasText(properties.getClientId(), "consumer.client-id must be set");
-     Assert.hasText(properties.getTopic(), "consumer.topic must be set");
      EndlessConsumer consumer =
          new EndlessConsumer(
              Executors.newFixedThreadPool(1),
@@@ -9,11 -12,18 +12,23 @@@ management
      web:
        exposure:
          include: "*"
+   info:
+     env:
+       enabled: true
+     java:
+       enabled: true
+ info:
+   kafka:
+     bootstrap-server: ${consumer.bootstrap-server}
+     client-id: ${consumer.client-id}
+     group-id: ${consumer.group-id}
+     topic: ${consumer.topic}
+     auto-offset-reset: ${consumer.auto-offset-reset}
 +spring:
 +  data:
 +    mongodb:
 +      uri: mongodb://juplo:training@localhost:27017
 +      database: juplo
  logging:
    level:
      root: INFO