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.PostMapping;
7 import org.springframework.web.bind.annotation.ResponseStatus;
8 import org.springframework.web.bind.annotation.RestController;
10 import java.util.concurrent.ExecutionException;
14 @RequiredArgsConstructor
15 public class DriverController
17 private final EndlessProducer producer;
27 public void stop() throws ExecutionException, InterruptedException
33 @ResponseStatus(HttpStatus.BAD_REQUEST)
34 public ErrorResponse illegalStateException(IllegalStateException e)
36 return new ErrorResponse(e.getMessage(), HttpStatus.BAD_REQUEST.value());