亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

Vertx-InfluxDB指標保持連接打開

Vertx-InfluxDB指標保持連接打開

慕無忌1623718 2021-04-16 15:19:30
我正在嘗試通過InfluxDB實例將指標報告合并到我的Vertx應用程序中。但是,當我嘗試正常結束我的應用程序時,某處有一個掛起的線程。我設法將其跟蹤到InfluxDB連接以進行vertx的指標報告,或者看起來如此,但是我沒有找到殺死它的方法。誰能指出我正確的方向?一個最小的工作示例(如果禁用指標,則應用程序會正常完成,否則將掛起):import io.vertx.core.Vertx;import io.vertx.core.VertxOptions;import io.vertx.micrometer.MicrometerMetricsOptions;import io.vertx.micrometer.VertxInfluxDbOptions;import io.vertx.micrometer.backends.BackendRegistries;public class MWE {    public static void main(String[] args) {        //setting up the metric options for influxdb. seems to work in MWE without credentials        MicrometerMetricsOptions metricsOptions = new MicrometerMetricsOptions()                .setRegistryName("data-client")                .setInfluxDbOptions(new VertxInfluxDbOptions()                        //disabling this would make sure the application _does_ gracefully exit                        .setEnabled(true)                )                .setEnabled(true);        //setting up the vertx instance        Vertx vertx = Vertx.vertx(                new VertxOptions()                        .setMetricsOptions(metricsOptions)                        .setWorkerPoolSize(50)        );        //stop vertx after a second        vertx.setTimer(1000, timerID -> {            //closing the vertx instance            vertx.close(result -> System.out.println("Vertx was closed."));            //closing the registry of metrics to influxdb            BackendRegistries.getNow("data-client").close();            System.out.println("Closed everything");        });        System.out.println("Done with main");    }}
查看完整描述

1 回答

  • 1 回答
  • 0 關注
  • 256 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號