main启动

# 阻塞启动

       
         Bootstrap bootstrap = Bootstrap.builder()
                .rootLevel(Level.DEBUG)
                .tcpConfig(
                        BootstrapConfig
                                .TcpConfig
                                .builder()
                                .port(8888)
                                .build())
                .httpConfig(
                        BootstrapConfig
                                .HttpConfig
                                .builder()
                                .enable(true)
                                .accessLog(true)
                                .httpAdmin(BootstrapConfig.HttpAdmin.builder().enable(true).username("smqtt").password("smqtt").build())
                                .build())
                .clusterConfig(
                        BootstrapConfig.
                                ClusterConfig
                                .builder()
                                .enable(true)
                                .namespace("smqtt")
                                .node("node-1")
                                .port(7773)
                                .url("127.0.0.1:7771,127.0.0.1:7772").
                                build())
                .build()
                .startAwait();
   
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30

# 非阻塞启动

  Bootstrap bootstrap = Bootstrap.builder()
         .rootLevel(Level.DEBUG)
         .tcpConfig(
                BootstrapConfig
                  .TcpConfig
                  .builder()
                  .port(8888)
                  .build())
          .httpConfig(
               BootstrapConfig
                    .HttpConfig
                     .builder()
                     .enable(true)
                     .accessLog(true)
                     .httpAdmin(BootstrapConfig.HttpAdmin.builder().enable(true).username("smqtt").password("smqtt").build())
                     .build())
          .clusterConfig(
                BootstrapConfig.
                     ClusterConfig
                      .builder()
                      .enable(true)
                      .namespace("smqtt")
                      .node("node-1")
                      .port(7773)
                      .url("127.0.0.1:7771,127.0.0.1:7772").
                       build())
          .build()
          .start().block();
          
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
Last Updated: 5/28/2022, 2:44:06 PM