• maven以及配置


    canal

    1. <dependency>
    2. <groupId>com.alibaba.ottergroupId>
    3. <artifactId>canal.clientartifactId>
    4. <version>1.1.6version>
    5. dependency>
    6. <dependency>
    7. <groupId>com.alibaba.ottergroupId>
    8. <artifactId>canal.protocolartifactId>
    9. <version>1.1.6version>
    10. dependency>

    oss

    1. <dependency>
    2. <groupId>com.aliyun.ossgroupId>
    3. <artifactId>aliyun-sdk-ossartifactId>
    4. <version>3.6.0version>
    5. dependency>

    lombok

    1. <dependency>
    2. <groupId>org.projectlombokgroupId>
    3. <artifactId>lombokartifactId>
    4. <optional>trueoptional>
    5. dependency>

     redis

    1. <dependency>
    2. <groupId>org.springframework.bootgroupId>
    3. <artifactId>spring-boot-starter-data-redisartifactId>
    4. dependency>
    5. <dependency>
    6. <groupId>org.apache.commonsgroupId>
    7. <artifactId>commons-pool2artifactId>
    8. dependency>

    es

    1. <dependency>
    2. <groupId>org.springframework.bootgroupId>
    3. <artifactId>spring-boot-starter-webartifactId>
    4. <exclusions>
    5. <exclusion>
    6. <groupId>org.elasticsearch.clientgroupId>
    7. <artifactId>elasticsearch-rest-high-level-clientartifactId>
    8. exclusion>
    9. <exclusion>
    10. <groupId>org.elasticsearchgroupId>
    11. <artifactId>elasticsearchartifactId>
    12. exclusion>
    13. exclusions>
    14. dependency>
    15. <dependency>
    16. <groupId>cn.easy-esgroupId>
    17. <artifactId>easy-es-boot-starterartifactId>
    18. <version>2.0.0-beta1version>
    19. dependency>
    20. <dependency>
    21. <groupId>org.elasticsearch.clientgroupId>
    22. <artifactId>elasticsearch-rest-high-level-clientartifactId>
    23. <version>7.14.0version>
    24. dependency>
    25. <dependency>
    26. <groupId>org.elasticsearchgroupId>
    27. <artifactId>elasticsearchartifactId>
    28. <version>7.14.0version>
    29. dependency>

     nacos

    1. <dependency>
    2. <groupId>com.alibaba.cloudgroupId>
    3. <artifactId>spring-cloud-starter-alibaba-nacos-configartifactId>
    4. dependency>
    5. <dependency>
    6. <groupId>com.alibaba.cloudgroupId>
    7. <artifactId>spring-cloud-starter-alibaba-nacos-discoveryartifactId>
    8. dependency>

    Spring Cloud的版本管理

    1. <dependency>
    2. <groupId>org.springframework.cloudgroupId>
    3. <artifactId>spring-cloud-dependenciesartifactId>
    4. <version>${spring.cloud.version}version>
    5. <type>pomtype>
    6. <scope>importscope>
    7. dependency>
    8. <dependency>
    9. <groupId>com.alibaba.cloudgroupId>
    10. <artifactId>spring-cloud-alibaba-dependenciesartifactId>
    11. <version>${spring.cloud.alibaba.version}version>
    12. <type>pomtype>
    13. <scope>importscope>
    14. dependency>
    15. <dependency>
    16. <groupId>org.mybatis.spring.bootgroupId>
    17. <artifactId>mybatis-spring-boot-starterartifactId>
    18. <version>2.3.0version>
    19. dependency>
    20. <dependency>
    21. <groupId>com.alibabagroupId>
    22. <artifactId>druid-spring-boot-starterartifactId>
    23. <version>1.2.9version>
    24. dependency>
    25. <dependency>
    26. <groupId>cn.hutoolgroupId>
    27. <artifactId>hutool-allartifactId>
    28. <version>5.8.11version>
    29. dependency>
    30. <dependency>
    31. <groupId>org.apache.httpcomponentsgroupId>
    32. <artifactId>httpclientartifactId>
    33. <version>4.5.13version>
    34. dependency>

    datasource 数据库配置

    1. <dependency>
    2. <groupId>mysqlgroupId>
    3. <artifactId>mysql-connector-javaartifactId>
    4. <scope>runtimescope>
    5. dependency>
    6. <dependency>
    7. <groupId>com.alibabagroupId>
    8. <artifactId>druid-spring-boot-starterartifactId>
    9. dependency>
    10. <dependency>
    11. <groupId>org.mybatis.spring.bootgroupId>
    12. <artifactId>mybatis-spring-boot-starterartifactId>
    13. dependency>
    14. <dependency>
    15. <groupId>cn.hutoolgroupId>
    16. <artifactId>hutool-allartifactId>
    17. dependency>

    配置

    数据库 datasource

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

    Druid连接池

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

    mybatis

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

     nacos

    1. #-------------------------Nacos配置-bootstrap.properties---------------------------------
    2. #------nacos地址------
    3. spring.cloud.nacos.server-addr=192.168.14.221:8848
    4. #------nacos配置名称------
    5. spring.cloud.nacos.config.name=product-app
    6. #------nacos命名空间id-----
    7. spring.cloud.nacos.config.namespace = public
    8. #------nacos默认组------
    9. spring.cloud.nacos.config.group = DEFAULT_GROUP
    1. #-------------------------Nacos服务发现注册中心配置------------------------------
    2. spring.cloud.nacos.discovery.server-addr=192.168.14.221:8848
    3. #spring.cloud.nacos.discovery.ip=192.168.14.11
    4. spring.application.name = product-app

    日志

    1. #日志
    2. logging.level.root=error
    3. 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

    饥饿加载

    1. #----------开启饥饿加载
    2. ribbon.eager-load.enabled=true
    3. spring.application.name=order1-app
    4. server.port=8080

    feign

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

     redis

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

    MQ

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

     oss依赖

    application.yml

    1. aliyun:
    2. oss:
    3. end-point: oss-cn-hangzhou.aliyuncs.com
    4. access-key-id: LTAI5tP1PMBCTZwQQkaxFtJv
    5. access-key-secret: PQu9XnsM2967Ct2NCyaCUYgMNf3GeZ
    6. bucket-name: wmsapp-images

  • 相关阅读:
    servlet
    【打卡】牛客网:BM49 表达式求值(调试很久)
    使用Fiddler模拟网络
    鸿枫网盘,文件夹面包屑跳转实现功能
    在Redux Toolkit中使用redux-persist进行状态持久化
    数据链路层重点协议-以太网
    sklearn快速入门教程:处理连续型特征
    最新:Selenium操作已经打开的Chrome(免登录)
    『现学现忘』Git基础 — 19、在Git中进行忽略文件操作
    MyBaties存储和查询json格式的数据(实体存储查询版本)
  • 原文地址:https://blog.csdn.net/qq_52963857/article/details/133815955