Example usage for io.vertx.core VertxOptions setMaxEventLoopExecuteTime

List of usage examples for io.vertx.core VertxOptions setMaxEventLoopExecuteTime

Introduction

In this page you can find the example usage for io.vertx.core VertxOptions setMaxEventLoopExecuteTime.

Prototype

public VertxOptions setMaxEventLoopExecuteTime(long maxEventLoopExecuteTime) 

Source Link

Document

Sets the value of max event loop execute time, in VertxOptions#setMaxEventLoopExecuteTimeUnit maxEventLoopExecuteTimeUnit .

Usage

From source file:com.hpe.sw.cms.verticle.Boot.java

License:Apache License

public static void main(String... args) throws IOException {
    String file = args[0];/*from  w w  w. jav  a2  s  .  co m*/
    //    String file="dockerWeb/startup.json";
    String confStr = FileUtils.readFileToString(new File(file));
    JsonObject jsonConf = new JsonObject(confStr);
    DeploymentOptions deploymentOptions = new DeploymentOptions(jsonConf);
    VertxOptions options = new VertxOptions();
    options.setMaxEventLoopExecuteTime(Long.MAX_VALUE);
    Vertx vertx = Vertx.vertx(options);
    vertx.deployVerticle(new Boot(), deploymentOptions, r -> {
        if (r.succeeded()) {
            LOG.info("Successfully deployed");
        } else {
            throw new RuntimeException(r.cause());
        }
    });
}

From source file:com.shampan.db.services.ServerExecutor.java

public static void main(String[] args) {
    //run Sample java web server
    VertxOptions options = new VertxOptions();
    //server execution time
    options.setMaxEventLoopExecuteTime(Long.MAX_VALUE);

    Vertx serviceAPIVerticle = Vertx.vertx(options);
    serviceAPIVerticle.deployVerticle(new ServerExecutor());
}

From source file:org.azrul.langmera.DecisionService.java

public static void main(String[] args) throws IOException {
    ConfigurationProvider config = null;
    ConfigFilesProvider configFilesProvider = () -> Arrays.asList(Paths.get("config.properties"));
    if (args.length <= 0) {
        ConfigurationSource source = new ClasspathConfigurationSource(configFilesProvider);
        config = new ConfigurationProviderBuilder().withConfigurationSource(source).build();
    } else {/*  w ww . ja v  a  2  s  . com*/
        ConfigurationSource source = new FilesConfigurationSource(configFilesProvider);
        Environment environment = new ImmutableEnvironment(args[0]);
        config = new ConfigurationProviderBuilder().withConfigurationSource(source).withEnvironment(environment)
                .build();

    }
    Logger logger = null;
    if (config.getProperty("log.file", String.class).isEmpty() == false) {
        FileHandler logHandler = new FileHandler(config.getProperty("log.file", String.class),
                config.getProperty("log.sizePerFile", Integer.class) * 1024 * 1024,
                config.getProperty("log.maxFileCount", Integer.class), true);
        logHandler.setFormatter(new SimpleFormatter());
        logHandler.setLevel(Level.INFO);

        Logger rootLogger = Logger.getLogger("");
        rootLogger.removeHandler(rootLogger.getHandlers()[0]);
        logHandler.setLevel(Level.parse(config.getProperty("log.level", String.class)));
        rootLogger.setLevel(Level.parse(config.getProperty("log.level", String.class)));
        rootLogger.addHandler(logHandler);

        logger = rootLogger;
    } else {
        logger = Logger.getGlobal();
    }

    VertxOptions options = new VertxOptions();
    options.setMaxEventLoopExecuteTime(Long.MAX_VALUE);
    options.setWorkerPoolSize(config.getProperty("workerPoolSize", Integer.class));
    options.setEventLoopPoolSize(40);

    Vertx vertx = Vertx.vertx(options);
    vertx.deployVerticle(new DecisionService(logger, config));
    vertx.deployVerticle(new SaveToDB(logger, config));

}

From source file:org.bdlions.server.ServerExecutor.java

public static void main(String[] args) {
    //initializing database
    try {//w w  w . j  av a  2 s.  co m
        Database.getInstance();
    } catch (DBSetupException ex) {
        System.out.println("Database setup exception. Please contact System Administrator.");
        return;
    }
    //run Sample java web server
    VertxOptions options = new VertxOptions();
    //server execution time
    options.setMaxEventLoopExecuteTime(Long.MAX_VALUE);

    //run Authentication server
    Vertx authVerticle = Vertx.vertx(options);
    authVerticle.deployVerticle(new AuthServer());

    //run keepalive server
    Vertx keepAliveVerticle = Vertx.vertx(options);
    keepAliveVerticle.deployVerticle(new KeepAliveServer());

    //run serviceAPI server
    Vertx serviceAPIVerticle = Vertx.vertx(options);
    serviceAPIVerticle.deployVerticle(new ServiceAPIServer());
    System.out.println("Server has started.");
    MessageQServer.getInstance().start();

    Broker broker = new Broker();
    broker.startBroker();

    ServerFuture.getInstance();

    BufferManager bufferManager = new BufferManager();
    ActiveMQManager activeMQManager = new ActiveMQManager(bufferManager, "activemqmanager");
    activeMQManager.start();

}