1 package de.juplo.kafka;
3 import lombok.RequiredArgsConstructor;
4 import org.springframework.http.HttpStatus;
5 import org.springframework.web.bind.annotation.ExceptionHandler;
6 import org.springframework.web.bind.annotation.GetMapping;
7 import org.springframework.web.bind.annotation.PostMapping;
8 import org.springframework.web.bind.annotation.ResponseStatus;
9 import org.springframework.web.bind.annotation.RestController;
12 import java.util.concurrent.ExecutionException;
16 @RequiredArgsConstructor
17 public class DriverController
19 private final EndlessConsumer consumer;
29 public void stop() throws ExecutionException, InterruptedException
35 public Map<Integer, Map<String, Long>> seen()
37 return consumer.getSeen();
41 @ResponseStatus(HttpStatus.BAD_REQUEST)
42 public ErrorResponse illegalStateException(IllegalStateException e)
44 return new ErrorResponse(e.getMessage(), HttpStatus.BAD_REQUEST.value());