微服务——远程调用

阅读 27

2024-08-24

背景:springcloud alibaba 微服务 maven引入的服务器依赖排除tomcat改为undertow后,启动服务依然是使用的tomcat作为服务器,undertow未生效

解决方案:启动类中增加指定内嵌服务器代码

代码如下:

@SpringBootApplication
public class RuoYiApplication {
    public static void main(String[] args)
    {
        SpringApplication.run(RuoYiApplication .class, args);
        System.out.println("(♥◠‿◠)ノ゙  分销打单抖店模块启动成功   ლ(´ڡ`ლ)゙  ");
    }

    // 重写configure方法,指定使用 Undertow
    @Bean
    public UndertowServletWebServerFactory servletWebServerFactory() {
        return new UndertowServletWebServerFactory();
    }
}

精彩评论(0)

0 0 举报