springboot
springboot
Wanted.
这个作者很懒,什么都没留下…
展开
-
springboot 动态切换 redis dbIndex
说明参考 https://www.cnblogs.com/wiliamzhao/p/13298948.htmlspringboot版本:2.0.3.RELEASE这里我们使用 LettuceConnectionFactory.setDatabase(dbIndex) 方法来切换redis dbpom配置<dependency> <groupId>org.springframework.boot</groupId> <artifactId>原创 2021-03-15 17:45:23 · 733 阅读 · 3 评论 -
maven 打包内存溢出的一种处理办法
报的错误是:系统资源不足。有关详细信息, 请参阅以下堆栈跟踪。java.lang.OutOfMemoryError: Java heap space处理办法:修改pom文件根据打包机器的实际性能配置<build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugi原创 2021-03-09 14:31:20 · 634 阅读 · 0 评论 -
feign client 在后端下载文件
feign client接口接收 feign.Responseimport feign.Response;import org.springframework.cloud.openfeign.FeignClient;import org.springframework.web.bind.annotation.GetMapping;import org.springframework.web.bind.annotation.RequestParam;/** * 文件服务client */..原创 2021-02-02 17:31:26 · 716 阅读 · 0 评论 -
springboot 集成 redis 工具类
1、pom文件<!-- redis --><dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-redis</artifactId></dependency>2、配置文件spring: redis: # Redis数据库索引(默认为0)原创 2021-02-01 15:41:58 · 67 阅读 · 0 评论 -
spring data jpa 自定义 repository
自定义一个repositoryimport org.springframework.data.jpa.repository.JpaRepository;import org.springframework.data.jpa.repository.JpaSpecificationExecutor;import org.springframework.data.repository.NoRepositoryBean;import java.io.Serializable;@NoReposito.原创 2020-08-11 16:49:11 · 194 阅读 · 0 评论 -
nginx 负载 swagger 网关
nginx配置http { include mime.types; default_type application/octet-stream; # upstream 负载 upstream swagger-upstream { server localhost:9003; # 可以负载权重等参数 server localhost:9004; } server { # 监听端口 listen 8888;.原创 2020-06-17 10:28:09 · 239 阅读 · 0 评论 -
springboot静态方法读取@Value配置
配置类package com.xxx.framework.xxx.common;import org.springframework.beans.factory.annotation.Value;import org.springframework.stereotype.Component;@Componentpublic class WxConstants { publi...原创 2020-03-17 18:01:47 · 2150 阅读 · 3 评论 -
springboot添加logback日志管理
application.yml配置logging: config: classpath:logback.xmllogback.xml配置<?xml version="1.0" encoding="UTF-8"?><configuration debug="false"> <!--定义日志文件的存储地址 勿在 LogBack 的配置中使用相对路...原创 2020-03-17 17:47:50 · 143 阅读 · 0 评论 -
springboot添加feign client
<!--feign 接口调用--> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-openfeign</artifactId> <version>2...原创 2020-03-17 17:43:33 · 378 阅读 · 0 评论 -
spring data jpa项目大批量数据库语句的一种方法
import javax.persistence.EntityManager;import javax.persistence.PersistenceContext;import java.sql.Connection;import java.sql.PreparedStatement;import java.sql.SQLException;@Transactionalpubli...原创 2020-01-09 17:27:11 · 404 阅读 · 0 评论 -
Springboot定时任务的一种写法
package com.xxx.framework.task;import org.slf4j.Logger;import org.slf4j.LoggerFactory;import org.springframework.beans.factory.annotation.Value;import org.springframework.scheduling.Trigger;impo...原创 2020-01-09 16:10:05 · 234 阅读 · 0 评论 -
Springboot读取配置properties文件
package com.genius.filemanage.config;import org.springframework.boot.context.properties.ConfigurationProperties;import org.springframework.context.annotation.PropertySource;import org.springframew...原创 2019-09-11 19:43:29 · 98 阅读 · 0 评论