canal
- <dependency>
- <groupId>com.alibaba.ottergroupId>
- <artifactId>canal.clientartifactId>
- <version>1.1.6version>
- dependency>
- <dependency>
- <groupId>com.alibaba.ottergroupId>
- <artifactId>canal.protocolartifactId>
- <version>1.1.6version>
- dependency>
-
- <dependency>
- <groupId>com.aliyun.ossgroupId>
- <artifactId>aliyun-sdk-ossartifactId>
- <version>3.6.0version>
- dependency>
- <dependency>
- <groupId>org.projectlombokgroupId>
- <artifactId>lombokartifactId>
- <optional>trueoptional>
- dependency>
- <dependency>
- <groupId>org.springframework.bootgroupId>
- <artifactId>spring-boot-starter-data-redisartifactId>
- dependency>
- <dependency>
- <groupId>org.apache.commonsgroupId>
- <artifactId>commons-pool2artifactId>
- dependency>
es
- <dependency>
- <groupId>org.springframework.bootgroupId>
- <artifactId>spring-boot-starter-webartifactId>
- <exclusions>
- <exclusion>
- <groupId>org.elasticsearch.clientgroupId>
- <artifactId>elasticsearch-rest-high-level-clientartifactId>
- exclusion>
- <exclusion>
- <groupId>org.elasticsearchgroupId>
- <artifactId>elasticsearchartifactId>
- exclusion>
- exclusions>
- dependency>
- <dependency>
- <groupId>cn.easy-esgroupId>
- <artifactId>easy-es-boot-starterartifactId>
- <version>2.0.0-beta1version>
- dependency>
- <dependency>
- <groupId>org.elasticsearch.clientgroupId>
- <artifactId>elasticsearch-rest-high-level-clientartifactId>
- <version>7.14.0version>
- dependency>
- <dependency>
- <groupId>org.elasticsearchgroupId>
- <artifactId>elasticsearchartifactId>
- <version>7.14.0version>
- dependency>
- <dependency>
- <groupId>com.alibaba.cloudgroupId>
- <artifactId>spring-cloud-starter-alibaba-nacos-configartifactId>
- dependency>
-
- <dependency>
- <groupId>com.alibaba.cloudgroupId>
- <artifactId>spring-cloud-starter-alibaba-nacos-discoveryartifactId>
- dependency>
Spring Cloud的版本管理
- <dependency>
- <groupId>org.springframework.cloudgroupId>
- <artifactId>spring-cloud-dependenciesartifactId>
- <version>${spring.cloud.version}version>
- <type>pomtype>
- <scope>importscope>
- dependency>
- <dependency>
- <groupId>com.alibaba.cloudgroupId>
- <artifactId>spring-cloud-alibaba-dependenciesartifactId>
- <version>${spring.cloud.alibaba.version}version>
- <type>pomtype>
- <scope>importscope>
- dependency>
- <dependency>
- <groupId>org.mybatis.spring.bootgroupId>
- <artifactId>mybatis-spring-boot-starterartifactId>
- <version>2.3.0version>
- dependency>
- <dependency>
- <groupId>com.alibabagroupId>
- <artifactId>druid-spring-boot-starterartifactId>
- <version>1.2.9version>
- dependency>
- <dependency>
- <groupId>cn.hutoolgroupId>
- <artifactId>hutool-allartifactId>
- <version>5.8.11version>
- dependency>
- <dependency>
- <groupId>org.apache.httpcomponentsgroupId>
- <artifactId>httpclientartifactId>
- <version>4.5.13version>
- dependency>
datasource 数据库配置
- <dependency>
- <groupId>mysqlgroupId>
- <artifactId>mysql-connector-javaartifactId>
- <scope>runtimescope>
- dependency>
-
- <dependency>
- <groupId>com.alibabagroupId>
- <artifactId>druid-spring-boot-starterartifactId>
- dependency>
-
- <dependency>
- <groupId>org.mybatis.spring.bootgroupId>
- <artifactId>mybatis-spring-boot-starterartifactId>
- dependency>
-
- <dependency>
- <groupId>cn.hutoolgroupId>
- <artifactId>hutool-allartifactId>
- dependency>
配置
数据库 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配置-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服务器地址
- 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
application.yml
- aliyun:
- oss:
- end-point: oss-cn-hangzhou.aliyuncs.com
- access-key-id: LTAI5tP1PMBCTZwQQkaxFtJv
- access-key-secret: PQu9XnsM2967Ct2NCyaCUYgMNf3GeZ
- bucket-name: wmsapp-images