Versendete Nachrichten an den neuen Kontrakt angepasst
[demos/kafka/training] / src / main / java / de / juplo / kafka / DriverController.java
index a504842..7f341be 100644 (file)
@@ -1,11 +1,9 @@
 package de.juplo.kafka;
 
 import lombok.RequiredArgsConstructor;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.http.HttpStatus;
+import org.springframework.web.bind.annotation.*;
 
-import java.util.Map;
 import java.util.concurrent.ExecutionException;
 
 
@@ -29,9 +27,10 @@ public class DriverController
   }
 
 
-  @GetMapping("seen")
-  public Map<Integer, Map<String, Integer>> seen()
+  @ExceptionHandler
+  @ResponseStatus(HttpStatus.BAD_REQUEST)
+  public ErrorResponse illegalStateException(IllegalStateException e)
   {
-    return consumer.getSeen();
+    return new ErrorResponse(e.getMessage(), HttpStatus.BAD_REQUEST.value());
   }
 }