protected synchronized void configExecutors() { if (shared) { handleExecutors = false; isExecutorShared = true; isAsyncExecutorShared = true; } executorService = ExecutorsFactory.getMessageDispatcher(config, broadcasterId); asyncWriteService = ExecutorsFactory.getAsyncOperationExecutor(config, broadcasterId); scheduler = ExecutorsFactory.getScheduler(config); }
logger.info("Shared ExecutorService supported: {}", sharedThreadPools); ExecutorService executorService = ExecutorsFactory.getMessageDispatcher(config, Broadcaster.ROOT_MASTER); if (executorService != null) { if (ThreadPoolExecutor.class.isAssignableFrom(executorService.getClass())) {
void startConsumer() { consumer.subscribe(Arrays.asList(topic)); ExecutorsFactory.getMessageDispatcher(config, "kafka").execute(new Runnable() { @Override public void run() { while (!closed.get()) { ConsumerRecords<String, String> records = consumer.poll(1000); for (ConsumerRecord<String, String> record : records) { broadcastReceivedMessage(record.value()); } } consumer.close(); ((Set<String>)config.properties().get("topics")).remove(topic); } }); }