• springboot 常用配置文件


    1.连接数据库

    <dependency>
    <groupId>org.mybatis.spring.boot</groupId>
    <artifactId>mybatis-spring-boot-starter</artifactId>
    <version>1.1.1</version>
    </dependency>

    #MyBatis 映射文件配置  指定mapper包路径
    mybatis.mapper-locations=classpath:com/springboot/mapper/*.xml
    #MyBatis扫描别名包,和 注解@Alias 
    mybatis.type-aliases-package=com.springboot.pojo
    #配置 typeHandler 的扫描包
    mybatis.type- handlers-package=com.springboot.typehandler
    #日志配置
    logging.level.root=DEBUG
    logging.level.org.springframework=DEBUG
    logging.level.org.org.mybatis=DEBUG

    2.连接Redis配置

    <!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-data-redis -->
    <dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-data-redis</artifactId>
    <version>2.1.3.RELEASE</version>
    </dependency>
    <!-- https://mvnrepository.com/artifact/redis.clients/jedis -->
    <dependency>
    <groupId>redis.clients</groupId>
    <artifactId>jedis</artifactId>
    <version>3.1.0-m1</version>
    </dependency>

    ### redis ip地址
    spring.redis.host=127.0.0.1

    ### redis 端口号
    spring.redis.port=6379

    ### redis密码
    spring.redis.password=123456

    ### redis 连接超时时间(单位:毫秒)
    spring.redis.timeout=1000

    ### 连接池最大连接数(如果是负数表示没有限制)
    spring.redis.jedis.pool.max - active=10 

    ### 连接池最大空闲连接数量(如果是负数表示没有限制)
    spring.redis.redis.pool.max-idle=10

    ### redis 最小空闲连接(如果是负数表示没有限制)

    spring.redis.jedis.pool.min-idle=5

    ### 连接池最大阻塞等待时间
    spring.redis.jedis.pool.max-wait=2000

    
    
  • 相关阅读:
    如何处理DateTime日期时间格式
    ASP.NET访问域用户(AD活动目录)信息的类
    多层代理取真实IP地址
    自动播放MP3文件
    Windows7 下用 grub4dos 安装 Ubuntu
    javascript判断iphone/android手机横竖屏模式
    C#一个到多个Cookie的字符串添加到CookieCollection集合中【isGood代码】
    css 文本对齐4种方法
    让VirtualBox虚拟机实现开机自动后台运行
    MSXML2, XmlHttpClass基础
  • 原文地址:https://www.cnblogs.com/ming-blogs/p/10709888.html
Copyright © 2020-2023  润新知