栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 前沿技术 > 大数据 > 大数据系统

SpringBoot中RabbitMQ & DB & Redis & mybatis的简单基础yml配置

SpringBoot中RabbitMQ & DB & Redis & mybatis的简单基础yml配置

spring:
  datasource:
    driver-class-name: com.mysql.cj.jdbc.Driver
    url: jdbc:mysql://localhost:3306/test?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf-8
    username: root
    password: 
    # druid连接池
    type: com.alibaba.druid.pool.DruidDataSource
    #初始连接数
    initialSize: 2
    #最小空闲数
    minIdle: 2
    #最大连接数
    maxActive: 2
    #最大超时数
    maxWait: 500

  rabbitmq:
    host: localhost
    port: 5672
    stream:
      username: guest
      password: guest
      port: 8080
    #生产者两种确认模式
    #confrim模式
    #也可用spring.rabbitmq.publisher-confirms=true
    publisher-/confirm/i-type: correlated
    #return模式
    publisher-returns: true
    #消费者确认
    listener:
    #用direct会报错
      simple:
        #开启手动确认模式
        acknowledge-mode: manual
        #消费消息限流
        prefetch: 1

  redis:
    database: 1
    port: 6379
    host: 
    password: 
    jedis:
      pool:
        #连接池最大连接数(使用负值表示没有限制)
        max-active: 8
        #连接池中的最大空闲连接
        max-idle: 8
        #连接池中的最小空闲连接
        min-idle: 0
        #连接池最大阻塞等待时间(使用负值表示没有限制)
        max-wait: -1
  #解决循环依赖
  main:
    allow-circular-references: true
server:
  port: ${port:8080}

#mybatis文件配置
mybatis:
  mapper-locations: classpath:mapper/*.xml
  type-aliases-package: com.rabbit.dao
  #可以将数据库的带下划线_给去掉然后映射到实体类的属性上去。
  configuration:
    map-underscore-to-camel-case: true

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/706860.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号