I know we can create TransportClient with something like - new TransportClient(settings).addTransportAddress(new InetSocketTransportAddress(host, port));
But here, I have to explicitly provide host and port info in my code.
I tried to get the instance of Transport Client solely through configuration properties in yml file. But it does not seem to work. I am getting "NoNodeAvailableException".
Here's content of my yml file -
And here's what I am doing to get instance of TransportClient
Builder builder = ImmutableSettings.settingsBuilder().loadFromClasspath("elasticsearch_test.yml");
TransportClient baseClient = new TransportClient(builder.build());
Call to baseClient.transportAddresses() returns null list object.
Is there any way to completely instantiate TransportClient without any explicit java code changes to add transport addresses?