# TransportClient thread safe?

**URL:** <https://discuss.elastic.co/t/transportclient-thread-safe/12366>\
**Category:** Elasticsearch\
**Created:** [June 12, 2013, 12:41am UTC](https://discuss.elastic.co/t/transportclient-thread-safe/12366 "2013-06-12T00:41:24Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![vinh](https://avatars.discourse-cdn.com/v4/letter/v/34f0e0/32.png) [@vinh](https://discuss.elastic.co/u/vinh)\
**Post date:** [June 12, 2013, 12:41am UTC](https://discuss.elastic.co/t/transportclient-thread-safe/12366/1 "2013-06-12T00:41:24Z")

</div>

Can one instance of TransportClient be shared across a set of clients threads? For example, if I have several objects which need to index messages to ES, can they share the same TransportClient?

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![vinh](https://avatars.discourse-cdn.com/v4/letter/v/34f0e0/32.png) [@vinh](https://discuss.elastic.co/u/vinh)\
**Post date:** [June 12, 2013, 1:44am UTC](https://discuss.elastic.co/t/transportclient-thread-safe/12366/2 "2013-06-12T01:44:22Z")

</div>

To clarify, I see errors in this type of setup. So just wanted to confirm.

On Jun 11, 2013, at 5:41 PM, vinh [vinh@loggly.com](mailto:vinh@loggly.com) wrote:

> Can one instance of TransportClient be shared across a set of clients threads? For example, if I have several objects which need to index messages to ES, can they share the same TransportClient?

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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:** [June 12, 2013, 5:09am UTC](https://discuss.elastic.co/t/transportclient-thread-safe/12366/3 "2013-06-12T05:09:55Z")

</div>

Yes. Only one client for the whole jvm. It's threadsafe.

--  
David 😉  
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 12 juin 2013 à 03:44, vinh [vinh@loggly.com](mailto:vinh@loggly.com) a écrit :

To clarify, I see errors in this type of setup. So just wanted to confirm.

On Jun 11, 2013, at 5:41 PM, vinh [vinh@loggly.com](mailto:vinh@loggly.com) wrote:

> Can one instance of TransportClient be shared across a set of clients threads? For example, if I have several objects which need to index messages to ES, can they share the same TransportClient?

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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 6, 2017, 2:31am UTC](https://discuss.elastic.co/t/transportclient-thread-safe/12366/4 "2017-07-06T02:31:43Z")

</div>


