The ServiceInstance not support IPv6 raw address

    ServiceInstance serviceInstance = loadBalancerClient.choose("ant-admin-v10");
    Uri  uri =  serviceInstance.getUri();

the uri is http://fe80::814:a2a:126c:1a2a:7878 What we really want is http://[fe80::814:a2a:126c:1a2a]:7878 IPv6 address with square brackets.

The ServiceInstance value :

{
    "name": "ant-admin-v10",
    "id": "5f1aae90-3f92-4eef-9cbf-efc3abd4029a",
    "address": "turing128",
    "port": 7878,
    "sslPort": null,
    "payload": {
        "@class": "org.springframework.cloud.zookeeper.discovery.ZookeeperInstance",
        "id": "application-1",
        "name": "ant-cloudadmin-v10",
        "metadata": {
            "instance_status": "UP"
        }
    },
    "registrationTimeUTC": 1654002749379,
    "serviceType": "DYNAMIC",
    "uriSpec": {
        "parts": [
            {
                "value": "scheme",
                "variable": true
            },
            {
                "value": "://",
                "variable": false
            },
            {
                "value": "address",
                "variable": true
            },
            {
                "value": ":",
                "variable": false
            },
            {
                "value": "port",
                "variable": true
            }
        ]
    }
}

Comment From: wilkinsona

ServiceInstance is part of Spring Cloud Commons.

Comment From: lyhu

OK,3KS