From: Kai Moritz Date: Sat, 23 Jul 2022 13:41:57 +0000 (+0200) Subject: Merge der überarbeiteten Compose-Konfiguration ('rebalance-listener') X-Git-Tag: wip-DEPRECATED~12^2~1 X-Git-Url: http://juplo.de/gitweb/?a=commitdiff_plain;h=ccf11628d5a1524d4bffe2f1b21b51ad713f1a67;p=demos%2Fkafka%2Ftraining Merge der überarbeiteten Compose-Konfiguration ('rebalance-listener') * Dabei auch die letzten Verbesserungen aus 'rebalance-listener' übernommen. --- ccf11628d5a1524d4bffe2f1b21b51ad713f1a67 diff --cc docker-compose.yml index 5723fc7,1b067cd..e30a7bb --- a/docker-compose.yml +++ b/docker-compose.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 index 78b2fde,9db9d9d..0fbe7e6 --- a/pom.xml +++ b/pom.xml @@@ -21,10 -21,10 +21,14 @@@ org.springframework.boot spring-boot-starter-web + + org.springframework.boot + spring-boot-starter-data-mongodb + + + org.springframework.boot + spring-boot-starter-validation + org.springframework.boot spring-boot-starter-actuator diff --cc src/main/java/de/juplo/kafka/Application.java index bcbf418,de4b66d..2f6e4f2 --- a/src/main/java/de/juplo/kafka/Application.java +++ b/src/main/java/de/juplo/kafka/Application.java @@@ -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), diff --cc src/main/resources/application.yml index 94490a3,9f3cb81..93b27c2 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@@ -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