# Transport Client in ES

**URL:** <https://discuss.elastic.co/t/transport-client-in-es/44110>\
**Category:** Elasticsearch\
**Created:** [March 11, 2016, 5:54am UTC](https://discuss.elastic.co/t/transport-client-in-es/44110 "2016-03-11T05:54:44Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![srinivas](https://avatars.discourse-cdn.com/v4/letter/s/ecccb3/32.png) [@srinivas](https://discuss.elastic.co/u/srinivas)\
**Post date:** [March 11, 2016, 5:54am UTC](https://discuss.elastic.co/t/transport-client-in-es/44110/1 "2016-03-11T05:54:44Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![mvg](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mvg/32/98890_2.png) [@mvg](https://discuss.elastic.co/u/mvg)\
**Post date:** [March 11, 2016, 9:19am UTC](https://discuss.elastic.co/t/transport-client-in-es/44110/2 "2016-03-11T09:19:13Z")

</div>

> [@srinivas](#):
>
> Can we have more than one Transport client in an application??

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

> [@srinivas](#):
>
> 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 you share why the transport client gets heavy? The delete by query operation occurs on cluster and not in the transport client.

---

<div class="post-metadata">

**Author:** ![srinivas](https://avatars.discourse-cdn.com/v4/letter/s/ecccb3/32.png) [@srinivas](https://discuss.elastic.co/u/srinivas)\
**Post date:** [March 12, 2016, 2:15pm UTC](https://discuss.elastic.co/t/transport-client-in-es/44110/3 "2016-03-12T14:15:50Z")

</div>

> [@mvg](#):
>
> 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

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [March 12, 2016, 3:52pm UTC](https://discuss.elastic.co/t/transport-client-in-es/44110/4 "2016-03-12T15:52:46Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![jprante](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jprante/32/44941_2.png) [@jprante](https://discuss.elastic.co/u/jprante)\
**Post date:** [March 12, 2016, 3:54pm UTC](https://discuss.elastic.co/t/transport-client-in-es/44110/5 "2016-03-12T15:54:25Z")

</div>

> [@srinivas](#):
>
> This may affect the search or index perfomance

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

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 5, 2017, 11:08pm UTC](https://discuss.elastic.co/t/transport-client-in-es/44110/6 "2017-07-05T23:08:52Z")

</div>


