Dubbo and Microservices use their respective NACOS as registries

Dubbo – API as a dubbo parent project relies on the following:

<! -- Dubbo -->
<dependency>
    <groupId>org.apache.dubbo</groupId>
    <artifactId>dubbo</artifactId>
    <version>2.7.8</version>
</dependency>
<! -- Dubbo Spring Boot Starter -->
<dependency>
    <groupId>org.apache.dubbo</groupId>
    <artifactId>dubbo-spring-boot-starter</artifactId>
    <version>2.7.8</version>
</dependency>
<! -- Netty -->
<dependency>
    <groupId>io.netty</groupId>
    <artifactId>netty-all</artifactId>
    <version>4.1.51. The Final</version>
</dependency>
<! -- https://mvnrepository.com/artifact/org.apache.commons/commons-lang3 -->
<dependency>
    <groupId>org.apache.commons</groupId>
    <artifactId>commons-lang3</artifactId>
    <version>3.12.0</version>
</dependency>
Copy the code

Refer to dubo-API in projects that require duboo

As shown in figure:

In-project dependencies for micro-services registered with NACOS, and other dependencies for implementing business functions. Configuration file:

server:
  port: 18083
spring:
  application:
    name: map
  cloud:
    nacos:
      discovery:
        server-addr: 127.0. 01.: 8848
      username: nacos
      password: nacos
management:
  endpoints:
    web:
      exposure:
        include: "*"
dubbo:
  application:
    name: map
  registry:
    address: Nacos: / / 127.0.0.1:8849
  consumer:
    check: false
  protocol:
    name: dubbo
    port: - 1
Copy the code

This makes it possible to separate the two registries. Doesn’t it seem easy, but it took a lot of work at the beginning.