예제 #1
0
  @Override
  public void start() {
    super.start();

    address = getOptionalStringConfig("address", "jonnywray.kairospersistor");
    host = getOptionalStringConfig("host", "localhost");
    port = getOptionalIntConfig("port", 8080);
    try {
      client =
          vertx.createHttpClient().setPort(port).setHost(host).setKeepAlive(true).setSSL(false);
      eb.registerHandler(address, this);

      container.logger().info("successfully started KairosDB persistor module");
    } catch (Exception e) {
      container.logger().error("error starting KairosDB persistor module", e);
      throw e;
    }
  }
예제 #2
0
  @Override
  public void start() {
    super.start();
    address = getOptionalStringConfig("address", "vertx.mod.testexample");
    gcm_registration_ids_limit =
        getOptionalIntConfig("gcm_registration_ids_limit", 1000); // gcm default
    gcm_max_seconds_to_leave =
        getOptionalIntConfig("gcm_max_seconds_to_leave", 2419200); // gcm default
    gcm_backoff_retries = getOptionalIntConfig("gcm_backoff_retries", 5);
    gcm_url = getOptionalStringConfig("gcm_url", "https://android.googleapis.com/gcm/send");
    gcm_port = getOptionalIntConfig("gcm_port", 443);

    gcm_max_backoff_delay = 1024000; // gcm default
    gcm_min_backoff_delay = 1000; // gcm default

    try {
      uri = new URI(voidNull(gcm_url));
    } catch (URISyntaxException e) {
    }

    eb.registerHandler(address, this);
    logger.debug("GCMServer worker was registered as " + address);
  }