private Runnable createProxyThreadRunnable() { Runnable runnable = () -> { isRunning = true; try { consumerPollThreadStartLatch.countDown(); LOG.info("Starting consumer poll thread {} for system {}", consumerPollThread.getName(), systemName); initializeLags(); while (isRunning) { fetchMessages(); } } catch (Throwable throwable) { LOG.error(String.format("Error in KafkaConsumerProxy poll thread for system: %s.", systemName), throwable); // KafkaSystemConsumer uses the failureCause to propagate the throwable to the container failureCause = throwable; isRunning = false; } if (!isRunning) { LOG.info("KafkaConsumerProxy for system {} has stopped.", systemName); } }; return runnable; }
private Runnable createProxyThreadRunnable() { Runnable runnable = () -> { isRunning = true; try { consumerPollThreadStartLatch.countDown(); LOG.info("Starting consumer poll thread {} for system {}", consumerPollThread.getName(), systemName); initializeLags(); while (isRunning) { fetchMessages(); } } catch (Throwable throwable) { LOG.error(String.format("Error in KafkaConsumerProxy poll thread for system: %s.", systemName), throwable); // KafkaSystemConsumer uses the failureCause to propagate the throwable to the container failureCause = throwable; isRunning = false; } if (!isRunning) { LOG.info("KafkaConsumerProxy for system {} has stopped.", systemName); } }; return runnable; }
private Runnable createProxyThreadRunnable() { Runnable runnable = () -> { isRunning = true; try { consumerPollThreadStartLatch.countDown(); LOG.info("Starting consumer poll thread {} for system {}", consumerPollThread.getName(), systemName); initializeLags(); while (isRunning) { fetchMessages(); } } catch (Throwable throwable) { LOG.error(String.format("Error in KafkaConsumerProxy poll thread for system: %s.", systemName), throwable); // KafkaSystemConsumer uses the failureCause to propagate the throwable to the container failureCause = throwable; isRunning = false; } if (!isRunning) { LOG.info("KafkaConsumerProxy for system {} has stopped.", systemName); } }; return runnable; }