use of com.netflix.conductor.grpc.server.GRPCServer in project conductor by Netflix.
the class MySQLGrpcEndToEndTest method setup.
@BeforeClass
public static void setup() throws Exception {
TestEnvironment.setup();
System.setProperty(GRPCServerConfiguration.ENABLED_PROPERTY_NAME, "true");
System.setProperty(GRPCServerConfiguration.PORT_PROPERTY_NAME, "8094");
System.setProperty(ElasticSearchConfiguration.EMBEDDED_PORT_PROPERTY_NAME, "9204");
System.setProperty(ElasticSearchConfiguration.ELASTIC_SEARCH_URL_PROPERTY_NAME, "localhost:9304");
System.setProperty(Configuration.EXECUTION_LOCK_ENABLED_PROPERTY_NAME, "false");
Injector bootInjector = Guice.createInjector(new BootstrapModule());
Injector serverInjector = Guice.createInjector(bootInjector.getInstance(ModulesProvider.class).get());
search = serverInjector.getInstance(EmbeddedElasticSearchProvider.class).get().get();
search.start();
Optional<GRPCServer> server = serverInjector.getInstance(GRPCServerProvider.class).get();
assertTrue("failed to instantiate GRPCServer", server.isPresent());
server.get().start();
taskClient = new TaskClient("localhost", SERVER_PORT);
workflowClient = new WorkflowClient("localhost", SERVER_PORT);
metadataClient = new MetadataClient("localhost", SERVER_PORT);
}
use of com.netflix.conductor.grpc.server.GRPCServer in project conductor by Netflix.
the class Main method main.
public static void main(String[] args) throws Exception {
BootstrapUtil.loadConfigFile(args.length > 0 ? args[0] : System.getenv("CONDUCTOR_CONFIG_FILE"));
if (args.length == 2) {
System.out.println("Using log4j config " + args[1]);
PropertyConfigurator.configure(new FileInputStream(new File(args[1])));
}
Injector bootstrapInjector = Guice.createInjector(new BootstrapModule());
ModulesProvider modulesProvider = bootstrapInjector.getInstance(ModulesProvider.class);
Injector serverInjector = Guice.createInjector(modulesProvider.get());
Optional<EmbeddedElasticSearch> embeddedElasticSearch = serverInjector.getInstance(EmbeddedElasticSearchProvider.class).get();
embeddedElasticSearch.ifPresent(BootstrapUtil::startEmbeddedElasticsearchServer);
BootstrapUtil.setupIndex(serverInjector.getInstance(IndexDAO.class));
try {
serverInjector.getInstance(IndexDAO.class).setup();
} catch (Exception e) {
e.printStackTrace(System.err);
System.exit(3);
}
BootstrapUtil.configureSummaryUtil(serverInjector.getInstance(Configuration.class));
System.out.println("\n\n\n");
System.out.println(" _ _ ");
System.out.println(" ___ ___ _ __ __| |_ _ ___| |_ ___ _ __ ");
System.out.println(" / __/ _ \\| '_ \\ / _` | | | |/ __| __/ _ \\| '__|");
System.out.println("| (_| (_) | | | | (_| | |_| | (__| || (_) | | ");
System.out.println(" \\___\\___/|_| |_|\\__,_|\\__,_|\\___|\\__\\___/|_| ");
System.out.println("\n\n\n");
Optional<GRPCServer> grpcServer = serverInjector.getInstance(GRPCServerProvider.class).get();
grpcServer.ifPresent(BootstrapUtil::startGRPCServer);
serverInjector.getInstance(JettyServerProvider.class).get().ifPresent(server -> {
try {
server.start();
} catch (Exception ioe) {
ioe.printStackTrace(System.err);
System.exit(3);
}
});
}
use of com.netflix.conductor.grpc.server.GRPCServer in project conductor by Netflix.
the class GrpcEndToEndTest method setup.
@BeforeClass
public static void setup() throws Exception {
TestEnvironment.setup();
System.setProperty(GRPCServerConfiguration.ENABLED_PROPERTY_NAME, "true");
System.setProperty(GRPCServerConfiguration.PORT_PROPERTY_NAME, "8092");
System.setProperty(ElasticSearchConfiguration.EMBEDDED_PORT_PROPERTY_NAME, "9202");
System.setProperty(ElasticSearchConfiguration.ELASTIC_SEARCH_URL_PROPERTY_NAME, "localhost:9302");
System.setProperty(Configuration.EXECUTION_LOCK_ENABLED_PROPERTY_NAME, "false");
Injector bootInjector = Guice.createInjector(new BootstrapModule());
Injector serverInjector = Guice.createInjector(bootInjector.getInstance(ModulesProvider.class).get());
search = serverInjector.getInstance(EmbeddedElasticSearchProvider.class).get().get();
search.start();
Optional<GRPCServer> server = serverInjector.getInstance(GRPCServerProvider.class).get();
assertTrue("failed to instantiate GRPCServer", server.isPresent());
server.get().start();
taskClient = new TaskClient("localhost", SERVER_PORT);
workflowClient = new WorkflowClient("localhost", SERVER_PORT);
metadataClient = new MetadataClient("localhost", SERVER_PORT);
}
Aggregations