ports:
- 8000:8080
environment:
+ server.port: 8080
producer.bootstrap-server: kafka:9092
producer.client-id: producer
producer.topic: test
consumer:
image: juplo/counting-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
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <goals>
+ <goal>build-info</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>pl.project13.maven</groupId>
+ <artifactId>git-commit-id-plugin</artifactId>
</plugin>
<plugin>
<groupId>io.fabric8</groupId>
package de.juplo.kafka;
import lombok.RequiredArgsConstructor;
+import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.ResponseStatus;
import org.springframework.web.bind.annotation.RestController;
import java.util.concurrent.ExecutionException;
}
@ExceptionHandler
+ @ResponseStatus(HttpStatus.BAD_REQUEST)
public ErrorResponse illegalStateException(IllegalStateException e)
{
- return new ErrorResponse(e.getMessage(), 400);
+ return new ErrorResponse(e.getMessage(), HttpStatus.BAD_REQUEST.value());
}
}
producer:
bootstrap-server: :9092
- client-id: peter
+ client-id: DEV
topic: test
acks: 1
throttle-ms: 1000
management:
+ endpoint:
+ shutdown:
+ enabled: true
endpoints:
web:
exposure:
include: "*"
+ info:
+ env:
+ enabled: true
+ java:
+ enabled: true
+info:
+ kafka:
+ bootstrap-server: ${producer.bootstrap-server}
+ client-id: ${producer.client-id}
+ topic: ${producer.topic}
+ acks: ${producer.acks}
+ throttle-ms: ${producer.throttle-ms}
logging:
level:
root: INFO
de.juplo: DEBUG
+server:
+ port: 8880