Transport Client in ES

Hi,

We have an requirement where we have to use the delete by query plugin.
As per new ES version 2.x the delete by query is used as an plugin through Transport client as shown below:
private TransportClient dc1Client = null;

this.dc1Client=TransportClient.builder().settings(settings).addPlugin(DeleteByQueryPlugin.class).build();

We have been using same transport client for indexing and searching. But adding the delete plugin will make it heavy while performing search and index operations.

Can we have more than one Transport client in an application??

one transport client for indexing and searching and another transport client for using delete by query plugin

Thanks,
Srinivas

Yes, but it is good practise to have you one transport client per application instance.

Can you share why the transport client gets heavy? The delete by query operation occurs on cluster and not in the transport client.

Since we are adding this plugin .addPlugin(DeleteByQueryPlugin.class). for every client connection called it has to load the plugin . This may affect the search or index perfomance

Build only the TransportClient once when you start your application. (Singleton)
Then share this instance.

This is not correct. Installing a plugin does not have any effect on search or index performance.