Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Elasticsearch get bounded port
val nodeRequest = new NodesInfoRequestBuilder(testCluster.esClient.admin().cluster()).all()
val nodeResponse = nodeRequest.execute().get()
val remoteAddress = nodeResponse.remoteAddress()
val nodesInfo = nodeResponse.getNodes.toList.head
val inetString = nodesInfo.getTransport.address().publishAddress().toString
val pattern =
val finallyPort = pattern.findFirstMatchIn(inetString)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.