maven以及配置

oss

oss配置

    
        
            com.aliyun.oss
            aliyun-sdk-oss
            3.6.0
        

lombok


        
            org.projectlombok
            lombok
            true
        

redis redis配置


        
            org.springframework.boot
            spring-boot-starter-data-redis
        
        
            org.apache.commons
            commons-pool2
        

es


        
            org.springframework.boot
            spring-boot-starter-web
            
                
                    org.elasticsearch.client
                    elasticsearch-rest-high-level-client
                
                
                    org.elasticsearch
                    elasticsearch
                
            
        
        
            cn.easy-es
            easy-es-boot-starter
            2.0.0-beta1
        
        
            org.elasticsearch.client
            elasticsearch-rest-high-level-client
            7.14.0
        
        
            org.elasticsearch
            elasticsearch
            7.14.0
        

nacos nacos配置


        
            com.alibaba.cloud
            spring-cloud-starter-alibaba-nacos-config
        

        
            com.alibaba.cloud
            spring-cloud-starter-alibaba-nacos-discovery
        

Spring Cloud的版本管理


            
                org.springframework.cloud
                spring-cloud-dependencies
                ${spring.cloud.version}
                pom
                import
            
            
                com.alibaba.cloud
                spring-cloud-alibaba-dependencies
                ${spring.cloud.alibaba.version}
                pom
                import
            
            
                org.mybatis.spring.boot
                mybatis-spring-boot-starter
                2.3.0
            
            
                com.alibaba
                druid-spring-boot-starter
                1.2.9
            
            
                cn.hutool
                hutool-all
                5.8.11
            
            
                org.apache.httpcomponents
                httpclient
                4.5.13
            

datasource 数据库配置


        
            mysql
            mysql-connector-java
            runtime
        

        
            com.alibaba
            druid-spring-boot-starter
        

        
            org.mybatis.spring.boot
            mybatis-spring-boot-starter
        

        
            cn.hutool
            hutool-all
        

配置

数据库 datasource

#数据库
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.datasource.url=jdbc:mysql://192.168.14.18:3306/three_group?useUnicode=true&characterEncoding=UTF-8&serverTimezone=UTC&allowMultiQueries=true
spring.datasource.username=root
spring.datasource.password=root123

Druid连接池

#Druid连接池
spring.datasource.type=com.alibaba.druid.pool.DruidDataSource
spring.datasource.druid.initial-size=3
spring.datasource.druid.min-idle=3
spring.datasource.druid.max-active=20
spring.datasource.druid.max-wait=6000

mybatis

#mybatis
mybatis.mapper-locations=classpath:mapper/**.xml
mybatis.type-aliases-package=com.beimao.model

nacos nacos依赖

#-------------------------Nacos配置-bootstrap.properties---------------------------------
#------nacos地址------
spring.cloud.nacos.server-addr=192.168.14.221:8848
#------nacos配置名称------
spring.cloud.nacos.config.name=product-app
#------nacos命名空间id-----
spring.cloud.nacos.config.namespace = public
#------nacos默认组------
spring.cloud.nacos.config.group = DEFAULT_GROUP

#-------------------------Nacos服务发现注册中心配置------------------------------
spring.cloud.nacos.discovery.server-addr=192.168.14.221:8848
#spring.cloud.nacos.discovery.ip=192.168.14.11
spring.application.name = product-app

日志

#日志
logging.level.root=error
logging.level.com.beimao=debug
logging.pattern.console=%d{yyyy-MM-dd HH:mm:ss.SSS} %clr(%-5level) %clr([%X{traceId}]) %clr(${PID:-}) --- %clr(%logger{50}) - %m%n

饥饿加载

#----------开启饥饿加载
ribbon.eager-load.enabled=true

spring.application.name=order1-app
server.port=8080

feign

# -------------- Feign 配置 --------------
feign.client.config.default.connectTimeout=5000
feign.client.config.default.readTimeout=10000
spring.cloud.nacos.discovery.ip=192.168.14.53

redis redis依赖

#redis
# Redis服务器地址
spring.redis.host=192.168.14.45
# Redis数据库索引(默认为0)
spring.redis.database=0
# Redis服务器连接端口
spring.redis.port=6379
# Redis服务器连接密码(默认为空)
#spring.redis.password=
# 连接池最大连接数(使用负值表示没有限制) 默认 8
spring.redis.lettuce.pool.max-active=8
# 连接池最大阻塞等待时间(使用负值表示没有限制) 默认 -1
spring.redis.lettuce.pool.max-wait=-1
# 连接池中的最大空闲连接 默认 8
spring.redis.lettuce.pool.max-idle=8
# 连接池中的最小空闲连接 默认 0
spring.redis.lettuce.pool.min-idle=0
## 连接超时时间(毫秒)
spring.redis.timeout=30000

MQ

#---连接MQ
spring.rabbitmq.host=192.168.14.54
spring.rabbitmq.virtual-host=/
spring.rabbitmq.port=5672
#-------------RabbitMQ配置----------
#最大抓取数量
spring.rabbitmq.listener.simple.prefetch=50
#是否开启自动应答,默认为true
spring.rabbitmq.listener.simple.acknowledge-mode=auto
#开启自动应答机制
spring.rabbitmq.listener.simple.retry.enabled=false
#设置重试次数,默认三次
spring.rabbitmq.listener.simple.retry.max-attempts=3
#设置重试间隔时间 单位ms
spring.rabbitmq.listener.simple.retry.initial-interval=1000ms
#设置时间间隔倍数,默认是1倍
spring.rabbitmq.listener.simple.retry.multiplier=2
#设置间隔时间
spring.rabbitmq.listener.simple.retry.max-interval=8000ms

OSS oss依赖

application.yml

aliyun:
  oss:
    end-point: oss-cn-hangzhou.aliyuncs.com
    access-key-id: LTAI5tP1PMBCTZwQQkaxFtJv
    access-key-secret: PQu9XnsM2967Ct2NCyaCUYgMNf3GeZ
    bucket-name: wmsapp-images

你可能感兴趣的:(springcloud,JavaSE入门与精通,maven,java,服务器)