Source:
<code>public StreamingResponseBody streamEvents( @PathVariable("subscription_id") final String subscriptionId, @RequestParam(value = "max_uncommitted_events", required = false, defaultValue = "10") final int maxUncommittedSize, @RequestParam(value = "batch_limit", required = false, defaultValue = "1") final int batchLimit, @Nullable @RequestParam(value = "stream_limit", required = false) final Long streamLimit, @RequestParam(value = "batch_flush_timeout", required = false, defaultValue = "30") final int batchTimeout, @Nullable @RequestParam(value = "stream_timeout", required = false) final Long streamTimeout, @Nullable @RequestParam(value = "stream_keep_alive_limit", required = false) final Integer streamKeepAliveLimit, final HttpServletRequest request, final HttpServletResponse response, final Client client) throws IOException { return outputStream -> { Counter consumerCounter = null; if (!featureToggleService.isFeatureEnabled(HIGH_LEVEL_API)) { response.setStatus(HttpServletResponse.SC_NOT_IMPLEMENTED); return; } <START> final String metricName = metricNameForSubscription(subscriptionId, CONSUMERS_COUNT_METRIC_NAME); <END> consumerCounter = metricRegistry.counter(metricName); consumerCounter.inc(); final AtomicBoolean connectionReady = closedConnectionsCrutch.listenForConnectionClose(request); SubscriptionStreamer streamer = null; final SubscriptionOutputImpl output = new SubscriptionOutputImpl(response, outputStream); try { if (blacklistService.isSubscriptionConsumptionBlocked(subscriptionId, client.getClientId())) { writeProblemResponse(response, outputStream, Problem.valueOf(Response.Status.FORBIDDEN, "Application or event type is blocked")); return; } final StreamParameters streamParameters = StreamParameters.of(batchLimit, streamLimit, batchTimeout, streamTimeout, streamKeepAliveLimit, maxUncommittedSize, nakadiSettings.getDefaultCommitTimeoutSeconds(), client.getClientId()); streamer = subscriptionStreamerFactory.build(subscriptionId, streamParameters, output, connectionReady, blacklistService); streamer.stream(); } catch (final InterruptedException ex) { LOG.warn("Interrupted while streaming with " + streamer, ex); Thread.currentThread().interrupt(); } catch (final Exception e) { output.onException(e); } finally { if (consumerCounter != null) { consumerCounter.dec(); } outputStream.close(); } }; }</code><technical_language>I add in feature, if is a need</technical_language>

Target:
public StreamingResponseBody streamEvents( @PathVariable("subscription_id") final String subscriptionId, @RequestParam(value = "max_uncommitted_events", required = false, defaultValue = "10") final int maxUncommittedSize, @RequestParam(value = "batch_limit", required = false, defaultValue = "1") final int batchLimit, @Nullable @RequestParam(value = "stream_limit", required = false) final Long streamLimit, @RequestParam(value = "batch_flush_timeout", required = false, defaultValue = "30") final int batchTimeout, @Nullable @RequestParam(value = "stream_timeout", required = false) final Long streamTimeout, @Nullable @RequestParam(value = "stream_keep_alive_limit", required = false) final Integer streamKeepAliveLimit, final HttpServletRequest request, final HttpServletResponse response, final Client client) throws IOException { return outputStream -> { if (!featureToggleService.isFeatureEnabled(HIGH_LEVEL_API)) { response.setStatus(HttpServletResponse.SC_NOT_IMPLEMENTED); return; } final String metricName = metricNameForSubscription(subscriptionId, CONSUMERS_COUNT_METRIC_NAME); final Counter consumerCounter = metricRegistry.counter(metricName); consumerCounter.inc(); final AtomicBoolean connectionReady = closedConnectionsCrutch.listenForConnectionClose(request); SubscriptionStreamer streamer = null; final SubscriptionOutputImpl output = new SubscriptionOutputImpl(response, outputStream); try { if (blacklistService.isSubscriptionConsumptionBlocked(subscriptionId, client.getClientId())) { writeProblemResponse(response, outputStream, Problem.valueOf(Response.Status.FORBIDDEN, "Application or event type is blocked")); return; } final StreamParameters streamParameters = StreamParameters.of(batchLimit, streamLimit, batchTimeout, streamTimeout, streamKeepAliveLimit, maxUncommittedSize, nakadiSettings.getDefaultCommitTimeoutSeconds(), client.getClientId()); streamer = subscriptionStreamerFactory.build(subscriptionId, streamParameters, output, connectionReady, blacklistService); streamer.stream(); } catch (final InterruptedException ex) { LOG.warn("Interrupted while streaming with " + streamer, ex); Thread.currentThread().interrupt(); } catch (final Exception e) { output.onException(e); } finally { consumerCounter.dec(); outputStream.close(); } }; }