示例#1
0
  @Override
  public void start() throws Exception {
    LOGGER.info("Starting Hermes Frontend");
    hermesFrontend =
        HermesFrontend.frontend()
            .withBinding(configFactory, ConfigFactory.class)
            .withHeadersPropagator(new TraceHeadersPropagator())
            .withLogRepository(
                serviceLocator ->
                    new MongoLogRepository(
                        FongoFactory.hermesDB(),
                        10,
                        1000,
                        configFactory.getStringProperty(Configs.KAFKA_CLUSTER_NAME),
                        serviceLocator.getService(MetricRegistry.class),
                        serviceLocator.getService(PathsCompiler.class)))
            .withKafkaTopicsNamesMapper(
                serviceLocator ->
                    new IntegrationTestKafkaNamesMapperFactory(
                            configFactory.getStringProperty(Configs.KAFKA_NAMESPACE))
                        .create())
            .build();

    client = new OkHttpClient();
    hermesFrontend.start();
    waitForStartup();
  }
示例#2
0
 @Override
 public void stop() throws Exception {
   LOGGER.info("Stopping Hermes Frontend");
   hermesFrontend.stop();
 }