Validierung erfolgt über spring-boot-starter-validation
[demos/kafka/training] / src / main / java / de / juplo / kafka / DriverController.java
1 package de.juplo.kafka;
2
3 import lombok.RequiredArgsConstructor;
4 import org.springframework.web.bind.annotation.PostMapping;
5 import org.springframework.web.bind.annotation.RestController;
6
7 import java.util.concurrent.ExecutionException;
8
9
10 @RestController
11 @RequiredArgsConstructor
12 public class DriverController
13 {
14   private final EndlessConsumer consumer;
15
16
17   @PostMapping("start")
18   public void start()
19   {
20     consumer.start();
21   }
22
23   @PostMapping("stop")
24   public void stop() throws ExecutionException, InterruptedException
25   {
26     consumer.stop();
27   }
28 }