Transport client - node.name

Hello,

In the transport client settings builder, I'm currently using node.name along with hosts. My settings builder looks like,

Settings.builder().put("cluster.name", "abc").put("node.name", "node1").put("client.transport.sniff", true);
..
client.addTransportAddress(....)
..
here ^, is node.name a mandatory field? I have seen some examples which includes node.name and some examples which doesn't include. Its not very clear from documentation. What happens when we leave node.name in the settings ?

It does not make sense to add a node name to something which is not a node but a client.

You don't have to set that.

Yes, makes sense.

I have a cluster with master and data nodes. I connect to the cluster from my app. I don't think have node.name in the client would matter.

Do you know why certain examples have this field set ? Just trying to understand, what's the need to have this setting or when this will be useful.

I believe examples were using a Node Client (which should not be used) instead of a Transport Client.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.