Helius
2021-06-21 5812839f3e23bb09e1a9b100b63273a646155709
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
31
32
33
34
35
package com.xzx.log;
 
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;
 
@EnableAsync
@EnableScheduling
@SpringBootApplication
@Slf4j
public class LogApplication extends SpringBootServletInitializer {
 
 
    static {
        /*
        SpringBoot 2.X 的 spring-boot-starter-data-redis 默认是以 lettuce 作为连接池的, 而在 lettuce , elasticsearch transport 中都会依赖 netty,二者的 netty 版本不一致,不能够兼容。
         */
        System.setProperty("es.set.netty.runtime.available.processors", "false");
    }
 
    @Override
    protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
        return application.sources(LogApplication.class);
    }
 
    public static void main(String[] args) {
 
        SpringApplication.run(LogApplication.class, args);
    }
 
}