private void getHostPortBinding(ServiceHost host, ContainerState containerState, Integer port, String hostAddress, BiConsumer<String, Integer> callback) { if (hostAddress == null || hostAddress.isEmpty()) { getContainerHost(host, containerState.parentLink, (h) -> { if (h == null) { callback.accept(null, port); return; } ContainerHostUtil.getHostPublicAddress(host, h, (publicAddress) -> { getHostPortBinding(host, containerState, port, publicAddress, callback); }); }); return; } callback.accept(UriUtilsExtended.extractHost(hostAddress), port); }