private static ServiceConfiguration loadConfig(String configFile) throws Exception { SLF4JBridgeHandler.removeHandlersForRootLogger(); SLF4JBridgeHandler.install(); ServiceConfiguration config = create((new FileInputStream(configFile)), ServiceConfiguration.class); // it validates provided configuration is completed isComplete(config); return config; }
public PulsarService(ServiceConfiguration config, Optional<WorkerService> functionWorkerService) { // Validate correctness of configuration PulsarConfigurationLoader.isComplete(config); state = State.Init; this.bindAddress = ServiceConfigurationUtils.getDefaultOrConfiguredAddress(config.getBindAddress()); this.advertisedAddress = advertisedAddress(config); this.webServiceAddress = webAddress(config); this.webServiceAddressTls = webAddressTls(config); this.brokerServiceUrl = brokerUrl(config); this.brokerServiceUrlTls = brokerUrlTls(config); this.brokerVersion = PulsarBrokerVersionStringUtils.getNormalizedVersionString(); this.config = config; this.shutdownService = new MessagingServiceShutdownHook(this); this.loadManagerExecutor = Executors .newSingleThreadScheduledExecutor(new DefaultThreadFactory("pulsar-load-manager")); this.functionWorkerService = functionWorkerService; }