Springboot 配置文件

Springboot 配置文件

这是我使用的yml配置文件application.yml

file:
  uploadFolder: D://upfile/
  staticAccessPath: /upfile/**
spring:
  devtools:
    restart:
      enabled: true  #设置开启热部署
      additional-paths: src/main/java #重启目录
      exclude: WEB-INF/**
    freemarker:
      cache: false    #页面不加载缓存,修改即时生效
      #总的配置文件
#   eurka server的名字
#  application:
#    name: springcloud-server
#  cloud:
#    config:
#      label: master   # 远程主干分支,可以修改为其余分支
#      server:
#        git:
#          uri: https://gitee.com/qingfeng_484150040/consumption  # 远程项目
#          search-paths: config  # 远程目录
#          username:  #  公共仓库,不需要用户名和密码
#          password:  #  公共仓库,不需要用户名和密码
#      kafka配置信息
#服务端
#  server:
#    port: 9601  # 三个注册中心,分别为9601、9602、9603
#
#  eureka:
#    instance:
#      hostname: eureka001
#    client:
#      #    registerWithEureka: false       # 默认为true 代表即是server也是client
#      #    fetchRegistry: false            # 默认为true 代表启用检索服务,三个服务中心相互复制数据
#      serviceUrl:
#        # 三个服务中心相互注册,9601注册9602和9603,9602注册9601和9603,9603注册9601和9602
#        defaultZone: http://localhost:8621/eureka/,http://localhost:9602/eureka/,http://localhost:9603/eureka/
#
#  # eurka server的名字
#  spring:
#    application:
#      name: eureka-service001  # 三个服务中心分别为001、002、003
#
#
#  客户端
#  eureka:
#    instance:
#      hostname: localhost
#    client:
#      serviceUrl:
#        #  这里的地址,必须是server的路径,并且必须是eureka的后缀路径
#        defaultZone: http://localhost:8621/eureka/
  kafka:
    bootstrap-servers: 192.168.0.124:9091
    consumer:
      group-id: kafka2
      auto-offset-reset: earliest
      key-deserializer: org.apache.kafka.common.serialization.StringDeserializer
      value-deserializer: org.apache.kafka.common.serialization.StringDeserializer
    producer:
      key-serializer: org.apache.kafka.common.serialization.StringSerializer
      value-serializer: org.apache.kafka.common.serialization.StringSerializer
  thymeleaf:
    cache: false
    mode: HTML5
    prefix: classpath:/templates/
    encoding: utf-8
    servlet:
      content-type: text/html
    suffix: .html
  datasource:
    driverClassName: com.mysql.jdbc.Driver
    url: jdbc:mysql://localhost:3306/entry?characterEncoding=utf-8&useSSL=false
    type: com.alibaba.druid.pool.DruidDataSource
    username: root
    password: 251314
    max-idle: 10
    max-wait: 10000
    min-idle: 5
    initial-size: 5
  jpa:
    database: mysql
    show-sql: true
    hibernate:
      ddl-auto: update
      naming-strategy: org.hibernate.cfg.ImprovedNamingStrategy
    redis:
      lettuce:
      pool:
        max-wait: 100
        max-active: 200
        max-idle: 10
        min-idle: -1
      host: localhost
      port: 6379
      password:
      timeout: 1000
server:
  port: 8888
  tomcat:
    uri-encoding: utf-8
mybatis:
  mapper-locations: classpath:mapper/*.xml
  configuration:
    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
    return-instance-for-empty-row: true
logging:
  level:
    org:
      springframework:
        web: ERROR
    com:
      yiibai: DEBUG
  pattern:
    console: "%d{yyyy-MM-dd HH:mm:ss} - %msg%n"
    file: "%d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger{36} - %msg%n"

#    /shiro
authc:
  loginUrl: /login    #用户登录的地址
roles:
  unauthorizedUrl: /login #用户没有对应角色的跳转重指向
logout:
  redirectUrl: /login #用户没有对应权限的跳转重指向



下面是我springboot配置dubbo使用到的配置文件,但愿能有所帮助

server.port=8181
dubbo.application.name=provider
dubbo.registry.protocol=zookeeper
dubbo.registry.address=127.0.0.1:2181
dubbo.protocol.port=20882
#超时时间设置
dubbo.provider.timeout=3000
#重复次数
dubbo.provider.retries=6
#mysal
spring.datasource.driverClassName = com.mysql.jdbc.Driver
spring.datasource.url = jdbc:mysql://localhost:3306/entry?characterEncoding=utf-8&useSSL=false
spring.datasource.username = root
spring.datasource.password = 251314
#jpa数据库语句显示修改
spring.jpa.database=mysql
spring.jpa.show-sql=true
spring.jpa.hibernate.ddl-auto=update
#kafka
spring.kafka.bootstrap-servers=192.168.0.124:9091
spring.kafka.consumer.group-id=kafka2
spring.kafka.consumer.auto-offset-reset=earliest
spring.kafka.consumer.key-deserializer=org.apache.kafka.common.serialization.StringDeserializer
spring.kafka.consumer.value-deserializer=org.apache.kafka.common.serialization.StringDeserializer
spring.kafka.producer.key-serializer=org.apache.kafka.common.serialization.StringSerializer
spring.kafka.producer.value-serializer=org.apache.kafka.common.serialization.StringSerializer
#mybatis
mybatis.mapper-locations=classpath:mapper/*.xml
mybatis.configuration.log-impl=org.apache.ibatis.logging.stdout.StdOutImpl
mybatis.configuration.return-instance-for-empty-row=true
#日志
logging.level.org.springframework.web=ERROR
logging.level.com.yiibai=DEBUG
logging.pattern.console="%d{yyyy-MM-dd HH:mm:ss} - %msg%n"
logging.pattern.file="%d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger{36} - %msg%n"

有啥问题都可以互相帮助的呢
青枫永远为你解答疑惑

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值