edit-icon download-icon

Register services to multiple registration centers

Last Updated: Mar 23, 2018

Multi-registration refers to a situation where Dubbo or HSF applications register services both in the EDAS and ZooKeeper registration centers to provide services to consumers.

Multi-subscription refers to a situation where Dubbo or HSF applications subscribe to services in both the EDAS and ZooKeeper registration center.

Follow these steps to register services to multiple registration centers.

  1. Add a dependency on EDAS SDK version 1.5.1 or later to the current application.

    1. <dependency>
    2. <groupId>com.alibaba.edas</groupId>
    3. <artifactId>edas-sdk</artifactId>
    4. <version>1.5.1</version>
    5. </dependency>
  2. Specify the ZooKeeper registration/subscription center address in either of the following two ways:

    • Specify the environment variable (for HSF and Dubbo applications):

      -Dhsf.registry.address=zookeeper://IP address:port

    • Add the following line to the XML file (for HSF applications only):

      <hsf:registry address="zookeeper://IP address:port" />

    If the ZooKeeper address is specified, Dubbo applications register and subscribe to services in both the EDAS and ZooKeeper registration centers by default. For HSF applications, you must call the invokeType parameter.

  3. Configure the parameter invoketype for registering and subscribing HSF services to both EDAS and ZooKeeper registration centers.

    • To register and subscribe to services in ConfigServer only: invokeType="hsf"
    • To register and subscribe to services in ZooKeeper only: invokeType="dubbo"
    • To register and subscribe to services in both the EDAS and ZooKeeper registration centers: invokeType="hsf, dubbo"
  4. Select a container of version 3.0 or later when creating an application, and upload and start it in the container.

Thank you! We've received your feedback.