From: Kai Moritz Date: Sun, 29 Sep 2024 13:32:38 +0000 (+0200) Subject: Namespace für Konfig von `producer` in `juplo.producer` geändert X-Git-Tag: producer/spring-producer--fixedsharding--null~5 X-Git-Url: http://juplo.de/gitweb/?a=commitdiff_plain;h=59d776da203dd623df7c5861643b6dfc17cc29d9;p=demos%2Fkafka%2Ftraining Namespace für Konfig von `producer` in `juplo.producer` geändert --- diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index 69ac986..5807af0 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -192,9 +192,9 @@ services: producer: image: juplo/spring-producer:1.0-SNAPSHOT environment: - producer.bootstrap-server: kafka:9092 - producer.client-id: producer - producer.topic: test + juplo.producer.bootstrap-server: kafka:9092 + juplo.producer.client-id: producer + juplo.producer.topic: test consumer-1: image: juplo/simple-consumer:1.0-SNAPSHOT diff --git a/src/main/java/de/juplo/kafka/ApplicationProperties.java b/src/main/java/de/juplo/kafka/ApplicationProperties.java index af663db..f33887c 100644 --- a/src/main/java/de/juplo/kafka/ApplicationProperties.java +++ b/src/main/java/de/juplo/kafka/ApplicationProperties.java @@ -8,7 +8,7 @@ import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.validation.annotation.Validated; -@ConfigurationProperties(prefix = "producer") +@ConfigurationProperties(prefix = "juplo.producer") @Validated @Getter @Setter diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index 0d5752c..6c2c08c 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -1,11 +1,12 @@ -producer: - bootstrap-server: :9092 - client-id: DEV - topic: test - acks: -1 - batch-size: 16384 - linger-ms: 0 - compression-type: gzip +juplo: + producer: + bootstrap-server: :9092 + client-id: DEV + topic: test + acks: -1 + batch-size: 16384 + linger-ms: 0 + compression-type: gzip management: endpoint: shutdown: @@ -21,13 +22,13 @@ management: enabled: true info: kafka: - bootstrap-server: ${producer.bootstrap-server} - client-id: ${producer.client-id} - topic: ${producer.topic} - acks: ${producer.acks} - batch-size: ${producer.batch-size} - linger-ms: ${producer.linger-ms} - compression-type: ${producer.compression-type} + bootstrap-server: ${juplo.producer.bootstrap-server} + client-id: ${juplo.producer.client-id} + topic: ${juplo.producer.topic} + acks: ${juplo.producer.acks} + batch-size: ${juplo.producer.batch-size} + linger-ms: ${juplo.producer.linger-ms} + compression-type: ${juplo.producer.compression-type} logging: level: root: INFO diff --git a/src/test/java/de/juplo/kafka/ApplicationTests.java b/src/test/java/de/juplo/kafka/ApplicationTests.java index 394007b..6d07e5a 100644 --- a/src/test/java/de/juplo/kafka/ApplicationTests.java +++ b/src/test/java/de/juplo/kafka/ApplicationTests.java @@ -29,8 +29,8 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers. properties = { "spring.kafka.bootstrap-servers=${spring.embedded.kafka.brokers}", "spring.kafka.consumer.auto-offset-reset=earliest", - "producer.bootstrap-server=${spring.embedded.kafka.brokers}", - "producer.topic=" + TOPIC}) + "juplo.producer.bootstrap-server=${spring.embedded.kafka.brokers}", + "juplo.producer.topic=" + TOPIC}) @AutoConfigureMockMvc @EmbeddedKafka(topics = TOPIC, partitions = PARTITIONS) @Slf4j