1 package de.juplo.kafka;
3 import lombok.RequiredArgsConstructor;
4 import org.springframework.http.HttpStatus;
5 import org.springframework.web.bind.annotation.*;
8 import java.util.concurrent.ExecutionException;
12 @RequiredArgsConstructor
13 public class DriverController
15 private final EndlessConsumer consumer;
16 private final KeyCountingRecordHandler keyCountingRecordHandler;
26 public void stop() throws ExecutionException, InterruptedException
33 public Map<Integer, Map<String, Long>> seen()
35 return keyCountingRecordHandler.getSeen();
40 @ResponseStatus(HttpStatus.BAD_REQUEST)
41 public ErrorResponse illegalStateException(IllegalStateException e)
43 return new ErrorResponse(e.getMessage(), HttpStatus.BAD_REQUEST.value());