Search in sources :

Example 1 with ProxyServer

use of com.yahoo.pulsar.websocket.service.ProxyServer in project pulsar by yahoo.

the class ProxyAuthenticationTest method setup.

@BeforeClass
public void setup() throws Exception {
    super.internalSetup();
    super.producerBaseSetup();
    WebSocketProxyConfiguration config = new WebSocketProxyConfiguration();
    config.setWebServicePort(TEST_PORT);
    config.setClusterName("use");
    config.setAuthenticationEnabled(true);
    config.setAuthenticationProviders(Sets.newHashSet("com.yahoo.pulsar.websocket.proxy.MockAuthenticationProvider"));
    service = spy(new WebSocketService(config));
    doReturn(mockZooKeeperClientFactory).when(service).getZooKeeperClientFactory();
    proxyServer = new ProxyServer(config);
    WebSocketServiceStarter.start(proxyServer, service);
    log.info("Proxy Server Started");
}
Also used : WebSocketProxyConfiguration(com.yahoo.pulsar.websocket.service.WebSocketProxyConfiguration) WebSocketService(com.yahoo.pulsar.websocket.WebSocketService) ProxyServer(com.yahoo.pulsar.websocket.service.ProxyServer) BeforeClass(org.testng.annotations.BeforeClass)

Example 2 with ProxyServer

use of com.yahoo.pulsar.websocket.service.ProxyServer in project pulsar by yahoo.

the class ProxyPublishConsumeTest method setup.

@BeforeClass
public void setup() throws Exception {
    super.internalSetup();
    super.producerBaseSetup();
    WebSocketProxyConfiguration config = new WebSocketProxyConfiguration();
    config.setWebServicePort(TEST_PORT);
    config.setClusterName("use");
    config.setGlobalZookeeperServers("dummy-zk-servers");
    service = spy(new WebSocketService(config));
    doReturn(mockZooKeeperClientFactory).when(service).getZooKeeperClientFactory();
    proxyServer = new ProxyServer(config);
    WebSocketServiceStarter.start(proxyServer, service);
    log.info("Proxy Server Started");
}
Also used : WebSocketProxyConfiguration(com.yahoo.pulsar.websocket.service.WebSocketProxyConfiguration) WebSocketService(com.yahoo.pulsar.websocket.WebSocketService) ProxyServer(com.yahoo.pulsar.websocket.service.ProxyServer) BeforeClass(org.testng.annotations.BeforeClass)

Example 3 with ProxyServer

use of com.yahoo.pulsar.websocket.service.ProxyServer in project pulsar by yahoo.

the class ProxyPublishConsumeTls method setup.

@BeforeClass
public void setup() throws Exception {
    super.internalSetup();
    super.producerBaseSetup();
    WebSocketProxyConfiguration config = new WebSocketProxyConfiguration();
    config.setWebServicePort(TEST_PORT);
    config.setWebServicePortTls(TLS_TEST_PORT);
    config.setTlsEnabled(true);
    config.setTlsKeyFilePath(TLS_SERVER_KEY_FILE_PATH);
    config.setTlsCertificateFilePath(TLS_SERVER_CERT_FILE_PATH);
    config.setClusterName("use");
    config.setGlobalZookeeperServers("dummy-zk-servers");
    service = spy(new WebSocketService(config));
    doReturn(mockZooKeeperClientFactory).when(service).getZooKeeperClientFactory();
    proxyServer = new ProxyServer(config);
    WebSocketServiceStarter.start(proxyServer, service);
    log.info("Proxy Server Started");
}
Also used : WebSocketProxyConfiguration(com.yahoo.pulsar.websocket.service.WebSocketProxyConfiguration) WebSocketService(com.yahoo.pulsar.websocket.WebSocketService) ProxyServer(com.yahoo.pulsar.websocket.service.ProxyServer) BeforeClass(org.testng.annotations.BeforeClass)

Example 4 with ProxyServer

use of com.yahoo.pulsar.websocket.service.ProxyServer in project pulsar by yahoo.

the class ProxyPublishConsumeWithoutZKTest method setup.

@BeforeClass
public void setup() throws Exception {
    super.internalSetup();
    super.producerBaseSetup();
    WebSocketProxyConfiguration config = new WebSocketProxyConfiguration();
    config.setWebServicePort(TEST_PORT);
    config.setClusterName("use");
    config.setServiceUrl(pulsar.getWebServiceAddress());
    config.setServiceUrlTls(pulsar.getWebServiceAddressTls());
    service = spy(new WebSocketService(config));
    doReturn(mockZooKeeperClientFactory).when(service).getZooKeeperClientFactory();
    proxyServer = new ProxyServer(config);
    WebSocketServiceStarter.start(proxyServer, service);
    log.info("Proxy Server Started");
}
Also used : WebSocketProxyConfiguration(com.yahoo.pulsar.websocket.service.WebSocketProxyConfiguration) WebSocketService(com.yahoo.pulsar.websocket.WebSocketService) ProxyServer(com.yahoo.pulsar.websocket.service.ProxyServer) BeforeClass(org.testng.annotations.BeforeClass)

Aggregations

WebSocketService (com.yahoo.pulsar.websocket.WebSocketService)4 ProxyServer (com.yahoo.pulsar.websocket.service.ProxyServer)4 WebSocketProxyConfiguration (com.yahoo.pulsar.websocket.service.WebSocketProxyConfiguration)4 BeforeClass (org.testng.annotations.BeforeClass)4