一、添加依赖 在pom.xml中添加 <!--rabbitmq--> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-amqp</artifactId> </dependency> 1. 2. 3. 4. 5. 二、配置 1.配置文件 application-dev.properties中添加 # === RabbitMQ === #配置rabbitMq 服务器 spri...
package configure; import handler.ResponseResultInterceptor; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; import org.springframework.context.annotation.Configuration; import org.springframework.web.servlet.config.annotation.I...
public StringBuilder defResponseBodyService(@RequestParam(name="count") Integer count,HttpServletRequest HttpRequest) throws InterruptedException{ String baseStr = "010101010101010101010101010101"; //32字符长度 StringBuilder sb = new StringBuilder(); for(i=1;i<=count;i++){ for(y=1;y<=32;y++){ s...
spring.application.admin.jmx-name = org .springframework.boot:type = Admin ,name = SpringApplication #应用程序管理MBean的JMX名称。 #AUTO-CONFIGURATION spring.autoconfigure.exclude =#要自动配置要排除的类。 #SPRING CORE spring.beaninfo.ignore = true #跳过搜索BeanInfo类。 #SPRING CACHE(CacheProperties...
关于Tomcat的默认配置,都在spring-configuration-metadata.json文件中,对应的配置类则是org.springframework.boot.autoconfigure.web.ServerProperties。 和处理请求数量相关的参数有四个: 「server.tomcat.threads.min-spare」:最少的工作线程数,默认大小是10。该参数相当于长期工,如果并发请求的数量达不到10,就会依次使用...
第一步:创建一个 WebFlux SpringBoot 项目 使用- start.spring.io 创建一个 SpringBoot maven 项目 添加以下依赖项: spring-boot-starter-web spring-boot-starter-data-redis spring-webflux spring-boot-starter-data-redis-reactive 参考pom.xml中的依赖 第二步:创建域对象 演示项目使用域对象 Customer 和...
8 Spring boot http response compression doesn't work for some User-Agents 20 How to zip- compress HTTP request with Spring RestTemplate? 28 Spring boot response compression not working 16 Handling gzipped requests in a Spring Boot REST application 5 Why is the gzip minimum ...
*/publicvoidfileDownload(Stringname, HttpServletResponseresponse) throwsException {Filefile=newFile("uploadFiles"+File.separator+name);JSONObjectresult=newJSONObject();if (!file.exists()) {result.put("msg", name+"文件不存在存在");}response.setContentType("application/force-download");response.add...
异常捕获(Spring Boot 全局异常处理---Spring Boot 全局异常处理及几点注意) @ControllerAdvicepublicclassGlobalExceptionHandler{privatefinalstaticLoggerlogger=LoggerFactory.getLogger(GlobalExceptionHandler.class);@ExceptionHandler(value=MultipartException.class)@ResponseBodypublicStringmultipartExceptionHandler(MaxUploadSize...