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--2024-11-13--si~10 X-Git-Url: http://juplo.de/gitweb/?a=commitdiff_plain;h=bbd23ec3faa2b1e6fcf4f9c729723696a7bf480d;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 ce53273..54114eb 100644 --- a/src/main/java/de/juplo/kafka/ApplicationProperties.java +++ b/src/main/java/de/juplo/kafka/ApplicationProperties.java @@ -10,7 +10,7 @@ import org.springframework.validation.annotation.Validated; import java.time.Duration; -@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 ce70629..f0217a6 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: 0 - compression-type: gzip +juplo: + producer: + bootstrap-server: :9092 + client-id: DEV + topic: test + acks: -1 + batch-size: 16384 + linger: 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: ${producer.linger} - 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: ${juplo.producer.linger} + 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