public static ServiceConfiguration convertFrom(PulsarConfiguration conf) throws RuntimeException { return convertFrom(conf, true); }
public WebSocketService(WebSocketProxyConfiguration config) { this(createClusterData(config), PulsarConfigurationLoader.convertFrom(config)); }
public void start() throws Exception { if (!isBlank(proxyConfig.getZookeeperServers()) && !isBlank(proxyConfig.getConfigurationStoreServers())) { discoveryProvider = new BrokerDiscoveryProvider(this.proxyConfig, getZooKeeperClientFactory()); this.configurationCacheService = new ConfigurationCacheService(discoveryProvider.globalZkCache); authorizationService = new AuthorizationService(PulsarConfigurationLoader.convertFrom(proxyConfig), configurationCacheService); } ServerBootstrap bootstrap = new ServerBootstrap(); bootstrap.childOption(ChannelOption.ALLOCATOR, PooledByteBufAllocator.DEFAULT); bootstrap.group(acceptorGroup, workerGroup); bootstrap.childOption(ChannelOption.TCP_NODELAY, true); bootstrap.childOption(ChannelOption.RCVBUF_ALLOCATOR, new AdaptiveRecvByteBufAllocator(1024, 16 * 1024, 1 * 1024 * 1024)); bootstrap.channel(EventLoopUtil.getServerSocketChannelClass(workerGroup)); EventLoopUtil.enableTriggeredMode(bootstrap); bootstrap.childHandler(new ServiceChannelInitializer(this, proxyConfig, false)); // Bind and start to accept incoming connections. try { bootstrap.bind(proxyConfig.getServicePort()).sync(); } catch (Exception e) { throw new IOException("Failed to bind Pulsar Proxy on port " + proxyConfig.getServicePort(), e); } LOG.info("Started Pulsar Proxy at {}", serviceUrl); if (proxyConfig.isTlsEnabledInProxy()) { ServerBootstrap tlsBootstrap = bootstrap.clone(); tlsBootstrap.childHandler(new ServiceChannelInitializer(this, proxyConfig, true)); tlsBootstrap.bind(proxyConfig.getServicePortTls()).sync(); LOG.info("Started Pulsar TLS Proxy on port {}", proxyConfig.getServicePortTls()); } }
PulsarConfigurationLoader.convertFrom(config));
/** * Starts discovery service by initializing zookkeeper and server * @throws Exception */ public void start() throws Exception { discoveryProvider = new BrokerDiscoveryProvider(this.config, getZooKeeperClientFactory()); this.configurationCacheService = new ConfigurationCacheService(discoveryProvider.globalZkCache); ServiceConfiguration serviceConfiguration = PulsarConfigurationLoader.convertFrom(config); authenticationService = new AuthenticationService(serviceConfiguration); authorizationService = new AuthorizationService(serviceConfiguration, configurationCacheService); startServer(); }