spring cloud 之consul

1、安裝consul

2、consul agent -dev啓動

3、

server:
  port: 9001


spring:
  servlet:
    multipart:
      max-file-size: 100MB
      max-request-size: 100MB
  profiles:
    active: dev
  application:
    name: enc-provider
  redis:
    database: 0
    host: 10.xx.xx
    port: 6379
    timeout: 5000
  datasource:
    url: jdbc:mysql://10.xx.xx:3306/enc-oss-view?useUnicode=yes&characterEncoding=UTF-8
    username: root
    password: root
    driver-class-name: com.mysql.cj.jdbc.Driver
  cloud:
    consul:
      host: 10.xx.xx
      port: 8500
      discovery:
        prefer-ip-address: true
        health-check-critical-timeout: 30s
  kafka:
    bootstrap-servers: 10.xx.xx:9092
    producer:
      retries: 0
      batch-size: 16384
      buffer-memory: 33554432
      key-serializer: org.apache.kafka.common.serialization.StringSerializer
      value-serializer: org.apache.kafka.common.serialization.StringSerializer

management:
  endpoints:
    web:
      exposure:
        include: "*"

mybatis:
  mapper-locations:
    - classpath*:/mapper/*-mapper.xml
  config-location: classpath:mybatis-config.xml




#mapper
mapper:
    mappers: com.encdata.oss.starter.web.base.EncMapper
    not-empty: false
    identity: MYSQL

#pagehelper
pagehelper:
    helperDialect: mysql
    reasonable: true
    supportMethodsArguments: true
    params: count=countSql
    pageSizeZero: true
    rowBoundsWithCount: true
    offsetAsPageNum: true


#日誌
logging:
  config: classpath:logback-${spring.profiles.active}.xml


info:
  security:
    enabled: false
    jwtSecret: encdata2019
    defaultExpiredDate: 1800
    whiteUrlList:
      - /user/login


fdfs:
  enabled: true
  # 讀取時間
  soTimeout: 5000
  # 連接超時時間
  connectTimeout: 5000
  # 縮略圖
  thumbImage:
    width: 150
    height: 150
  # tracker列表
  trackerList: 10.xx.xx:22122
  return-url: http://10.xx.xx:9999/

4、註解

@SpringBootApplication
@EnableDiscoveryClient
@EnableTransactionManagement
@MapperScan(value = "com.xx.oss.bakend.mapper",annotationClass = Repository.class)
@EnableFeignClients(basePackages = {"com.xx.oss.user.api"})
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章