在 springboot 应用程序中配置 mvc 异步任务执行器 [英] Configuring mvc async task executor in springboot application

查看:58
本文介绍了在 springboot 应用程序中配置 mvc 异步任务执行器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试覆盖 SpringBoot/SpringMVC 应用程序中 RequestMappingHandlerAdapter bean 使用的默认任务执行器.

I am trying to override the default task executor used by the RequestMappingHandlerAdapter bean in a SpringBoot/SpringMVC application.

javadocs 建议替换默认值的使用,但没有给出任何关于如何执行此操作的指示,我也无法在 SpringBoot 文档中找到任何内容.

The javadocs recommend to replace the use of the default but do not give any indication on how to do this nor can I find anything in the SpringBoot documentation.

推荐答案

WebMvcConfigurer 具有用于配置异步支持的回调 (https://github.com/spring-projects/spring-framework/blob/master/spring-webmvc/src/main/java/org/springframework/web/servlet/config/annotation/WebMvcConfigurer.java#L92).

The WebMvcConfigurer has a callback for configuring async support (https://github.com/spring-projects/spring-framework/blob/master/spring-webmvc/src/main/java/org/springframework/web/servlet/config/annotation/WebMvcConfigurer.java#L92).

这篇关于在 springboot 应用程序中配置 mvc 异步任务执行器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆