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); } }