Registry routing

Updated at:

After you import the Spring Cloud SOFA Router module into your project and enable the SOFA routing feature, you can use Spring Cloud SOFA Registry to manage registry routing.

The registry provides the following two routing capabilities. For more information about the SOFA routing feature, see Service routing (Spring Cloud SOFA Router).

Nearest access

You can enable the nearest access routing feature by configuring location information in the public configuration. SOFA nearest access uses a convergence rule of Zone > DataCenter > Region. It prioritizes providers in the same zone. If no providers are in the same zone, it selects providers in the same data center. If none are found there, it selects providers in the same region. If convergence fails, a provider is selected from all available providers.

The SOFA nearest access feature reduces cross-region access when you correctly configure location information for your application. This ensures an optimal link in most cases and enables multi-active capabilities. You should enable this feature in a multi-active architecture.

The SOFA registry provides native support for multi-site, multi-active architectures. For more information, see Multi-cluster synchronization.

IPv6 routing

Spring Cloud SOFA supports smooth migration to IPv6. To switch your network stack to IPv6, ensure that the runtime environment supports an IPv4 and IPv6 dual-stack. Spring Cloud SOFA automatically detects both address types and prioritizes communication between nodes that are IPv6-enabled. After all nodes are IPv6-enabled, you can gradually shut down the IPv4 protocol.

IPv6 routing is disabled by default. To enable it, set the value of spring.cloud.sofa.router.ipv6.enabled to true in the application.properties file. After this feature is enabled, Spring Cloud SOFA automatically detects valid IPv6 addresses and performs same-stack routing to ensure a smooth protocol stack migration.

spring.cloud.sofa.router.ipv6.enabled=true