@Override
    public void registerRemote(RemoteInstance remoteInstance) throws ServiceRegisterException {
        if (needUsingInternalAddr()) {
            remoteInstance = new RemoteInstance(
                new Address(config.getInternalComHost(), config.getInternalComPort(), true));
        }
        this.selfAddress = remoteInstance.getAddress();
        try {
            AgentClient agentClient = client.agentClient();
            Registration registration = ImmutableRegistration.builder()
                                                             .id(remoteInstance.getAddress().toString())
                                                             .name(serviceName)
                                                             .address(remoteInstance.getAddress().getHost())
                                                             .port(remoteInstance.getAddress().getPort())
                                                             .check(Registration.RegCheck.grpc(
                                                                 remoteInstance.getAddress()
                                                                               .getHost() + ":" + remoteInstance
                                                                     .getAddress()
                                                                     .getPort(),
                                                                 5
                                                             )) // registers with a TTL of 5 seconds
                                                             .build();

            agentClient.register(registration);
            healthChecker.health();

        } catch (Throwable e) {
            healthChecker.unHealth(e);
            throw new ServiceRegisterException(e.getMessage());
        }
    }
@Test
    public void registerRemoteUsingInternal() {
        consulConfig.setInternalComHost(internalAddress.getHost());
        consulConfig.setInternalComPort(internalAddress.getPort());
        registerRemote(internalAddress);
    }