栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Java

dubbo 配置

Java 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

dubbo 配置

1:  一个提供接口,一个实现接口

2:  yml

#server:
#  port: 8122
#   servlet.context-path: /test
spring:
  application:
    name: server-account
  main:
    allow-bean-definition-overriding: true
  cloud:
    nacos:
      discovery:
        server-addr: 192.168.0.109:8848
        namespace: common
        group: common
      config:
        server-addr: 192.168.0.109:8848
        file-extension: yaml
        namespace: common
        shared-configs: common-tool.yaml
        refresh-enabled: true
        group: common
  datasource:
    username: root
    password: xxxxxxx
    url: jdbc:mysql://192.168.0.109:3306/vily-common?useUnicode=true&characterEncoding=utf-8&serverTimezone=UTC
    driver-class-name: com.mysql.jdbc.Driver
  redis:
    # redis数据库索引(默认为0),我们使用索引为3的数据库,避免和其他数据库冲突
    database: 3
    host: 192.168.0.109
    port: 6379
    # redis访问密码(默认为空)
    password: xxxxx
    timeout: 1000
dubbo:
  scan:
    base-packages: com.vily.petlove.dubbo
  protocol:
    name: dubbo
    port: 18122
      # 注册中心配置
  registry:
    address: nacos://192.168.0.109:8848
    group: common
  application:
    name: server-account

mybatis:
  type-aliases-package: learning.model
  #mapper.xml所在位置
  mapper-locations: classpath:mybatis/mappers/*.xml

 3: 不要忘记

 4:  接口实现,一个是远程调用的@service,一个是可供本地使用的@service

 

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/1020778.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号