docker-compose up -d peter klaus
-sleep 10
-docker-compose kill -s9 peter klaus
+sleep 5
+echo 17 | http -v :8080/foo?error=1
+docker-compose stop peter klaus
# tag::kafkacat[]
kafkacat -b :9092 -t test -o 0 -e -f 'p=%p|o=%o|k=%k|h=%h|v=%s\n'
public DeferredResult<ProduceResult> send(
@PathVariable String key,
@RequestHeader(name = "X-id", required = false) Long correlationId,
- @RequestBody Integer number)
+ @RequestBody Integer number,
+ @RequestParam(required = false) boolean error)
{
ResultRecorder result = new ResultRecorder(number+1);
for (int i = 1; i <= number; i++)
{
- send(key, new AddNumberMessage(number, i), correlationId, result);
+ int next = error && i == (number+1)/2 ? i * -1 : i;
+ send(key, new AddNumberMessage(number, next), correlationId, result);
}
send(key, new CalculateSumMessage(number), correlationId, result);