@Override protected void process(CommandLine cli) { super.process(cli); builder.withDiscoveryPort(Integer.parseInt(cli.getOptionValue("r", "" + DEFAULT_DISCOVERY_PORT))); } }
@Override public int scaleUpByOne() { int discoveryPort = ephemeralPorts ? 0 : nextAvailablePort; int httpPort = ephemeralPorts ? 0 : nextAvailablePort + 1; int adminPort = ephemeralPorts ? 0 : nextAvailablePort + 2; EurekaServerConfig config = EurekaServerConfig.baseBuilder() .withAppName(READ_SERVER_NAME) .withVipAddress(READ_SERVER_NAME) .withReadClusterVipAddress(READ_SERVER_NAME) .withDataCenterType(DataCenterType.Basic) .withDiscoveryPort(discoveryPort) .withHttpPort(httpPort) .withShutDownPort(0) // We do not run shutdown service in embedded server .withWebAdminPort(adminPort) .withCodec(codec) .build(); EmbeddedReadServer newServer = newServer(config); newServer.start(); nextAvailablePort += 10; if (ephemeralPorts) { discoveryPort = newServer.getDiscoveryPort(); } return scaleUpByOne(newServer, new Server("localhost", discoveryPort)); }
@Override protected void before() throws Throwable { EurekaServerConfig config = EurekaServerConfig.baseBuilder() .withAppName(name) .withVipAddress(name) .withDataCenterType(DataCenterType.Basic) .withHttpPort(0) .withDiscoveryPort(0) .withShutDownPort(0) .withWebAdminPort(0) .withCodec(codec) .build(); ServerResolver registrationResolver = ServerResolvers.fromHostname("localhost").withPort(writeServerResource.getRegistrationPort()); ServerResolver discoveryResolver = ServerResolvers.fromHostname("localhost").withPort(writeServerResource.getDiscoveryPort()); server = new EmbeddedReadServer(EMBEDDED_READ_CLIENT_ID, config, registrationResolver, discoveryResolver, false, false); server.start(); // Find ephemeral port numbers discoveryPort = server.getInjector().getInstance(TcpDiscoveryServer.class).serverPort(); }
@Override protected void before() throws Throwable { EurekaServerConfig config = EurekaServerConfig.baseBuilder() .withAppName(name) .withVipAddress(name) .withDataCenterType(DataCenterType.Basic) .withDiscoveryPort(0) .withShutDownPort(0) .withWebAdminPort(0) .withCodec(Codec.Avro) .build(); ServerResolver registrationResolver = ServerResolvers.just("localhost", writeServerResource.getRegistrationPort()); ServerResolver discoveryResolver = ServerResolvers.just("localhost", writeServerResource.getDiscoveryPort()); server = new EmbeddedReadServer(config, registrationResolver, discoveryResolver, false, false); server.start(); // Find ephemeral port numbers discoveryPort = server.getInjector().getInstance(TcpDiscoveryServer.class).serverPort(); }
@Override public int scaleUpByOne() { int discoveryPort = nextAvailablePort; EurekaServerConfig config = EurekaServerConfig.baseBuilder() .withAppName(READ_SERVER_NAME) .withVipAddress(READ_SERVER_NAME) .withDataCenterType(DataCenterType.Basic) .withDiscoveryPort(discoveryPort) .withShutDownPort(nextAvailablePort + 1) .withWebAdminPort(nextAvailablePort + 2) .withCodec(Codec.Avro) .build(); EmbeddedReadServer newServer = newServer(config); newServer.start(); nextAvailablePort += 10; return scaleUpByOne(newServer, new Server("localhost", discoveryPort)); }
public static EurekaServerConfigBuilder baseBuilder() { return new EurekaServerConfigBuilder(); }
public static EurekaServerConfigBuilder baseBuilder() { return new EurekaServerConfigBuilder(); }