From a275d3f1611045491c021f81899760df2f0e8438 Mon Sep 17 00:00:00 2001 From: vstepanov Date: Wed, 8 May 2019 15:25:11 +0200 Subject: [PATCH] INC-44977: reverted changes; --- .../controller/SubscriptionStreamController.java | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/src/main/java/org/zalando/nakadi/controller/SubscriptionStreamController.java b/src/main/java/org/zalando/nakadi/controller/SubscriptionStreamController.java index fba192a768..50505d1df4 100644 --- a/src/main/java/org/zalando/nakadi/controller/SubscriptionStreamController.java +++ b/src/main/java/org/zalando/nakadi/controller/SubscriptionStreamController.java @@ -46,7 +46,6 @@ import java.io.OutputStream; import java.util.HashMap; import java.util.Map; -import java.util.Random; import java.util.concurrent.atomic.AtomicBoolean; import java.util.function.Function; @@ -56,7 +55,6 @@ import static org.zalando.problem.Status.INTERNAL_SERVER_ERROR; import static org.zalando.problem.Status.NOT_FOUND; import static org.zalando.problem.Status.SERVICE_UNAVAILABLE; -import static org.zalando.problem.Status.TOO_MANY_REQUESTS; import static org.zalando.problem.Status.UNPROCESSABLE_ENTITY; @RestController @@ -72,7 +70,6 @@ public class SubscriptionStreamController { private final MetricRegistry metricRegistry; private final SubscriptionDbRepository subscriptionDbRepository; private final SubscriptionValidationService subscriptionValidationService; - private final Random random; @Autowired public SubscriptionStreamController(final SubscriptionStreamerFactory subscriptionStreamerFactory, @@ -91,7 +88,6 @@ public SubscriptionStreamController(final SubscriptionStreamerFactory subscripti this.metricRegistry = metricRegistry; this.subscriptionDbRepository = subscriptionDbRepository; this.subscriptionValidationService = subscriptionValidationService; - this.random = new Random(); } class SubscriptionOutputImpl implements SubscriptionOutput { @@ -216,12 +212,6 @@ private StreamingResponseBody stream(final String subscriptionId, SubscriptionStreamer streamer = null; final SubscriptionOutputImpl output = new SubscriptionOutputImpl(response, outputStream); try { - if ("stups_zalos".equals(client.getClientId()) && random.nextInt(10) >= 5) { - writeProblemResponse(response, outputStream, - Problem.valueOf(TOO_MANY_REQUESTS, "Application stups_zalos is throttled")); - return; - } - if (blacklistService.isSubscriptionConsumptionBlocked(subscriptionId, client.getClientId())) { writeProblemResponse(response, outputStream, Problem.valueOf(FORBIDDEN, "Application or event type is blocked"));