SpringBoot的Redis、RabbitMQ的yml配置

直接copy

server:
  port: 8089
spring:
  datasource:
    url: jdbc:mysql://127.0.0.1:3306/demotest?useUnicode=true&characterEncoding=UTF-8
    username: root
    password: root
    type: com.alibaba.druid.pool.DruidDataSource
    driver-class-name: com.mysql.jdbc.Driver

mybatis:
  mapper-locations: classpath:/mapper/*Dao.xml

redis:
  # redis數據庫索引(默認爲0),我們使用索引爲3的數據庫,避免和其他數據庫衝突
  database: 3
  # redis服務器地址(默認爲loaclhost)
  host: loaclhost
  # redis端口(默認爲6379)
  post: 6379
  # redis訪問密碼(默認爲空)
  password: 
  # redis連接超時時間(單位毫秒)
  timeout: 0
  # redis連接池配置
  pool:
    # 最大可用連接數(默認爲8,負數表示無限)
    max-active: 8
    # 最大空閒連接數(默認爲8,負數表示無限)
    max-idle: 8
    # 最小空閒連接數(默認爲0,該值只有爲正數纔有用)
    min-idle: 0
    # 從連接池中獲取連接最大等待時間(默認爲-1,單位爲毫秒,負數表示無限)
    max-wait: -1

mq:
  rabbit:
    host: localhost(換成自己的ip)
    port: 5672
    virtualHost: /
    username: guest
    password: guest在這裏插入代碼片

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章