# REST client to call external service in a Elasticsearch custom plugin

**URL:** <https://discuss.elastic.co/t/rest-client-to-call-external-service-in-a-elasticsearch-custom-plugin/161874>\
**Category:** Elasticsearch\
**Created:** [December 21, 2018, 3:42pm UTC](https://discuss.elastic.co/t/rest-client-to-call-external-service-in-a-elasticsearch-custom-plugin/161874 "2018-12-21T15:42:44Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Uiidoi12](https://avatars.discourse-cdn.com/v4/letter/u/73ab20/32.png) [@Uiidoi12](https://discuss.elastic.co/u/Uiidoi12)\
**Post date:** [December 21, 2018, 3:42pm UTC](https://discuss.elastic.co/t/rest-client-to-call-external-service-in-a-elasticsearch-custom-plugin/161874/1 "2018-12-21T15:42:44Z")

</div>

Hi,

I'm building an Elasticsearch plugin and need to call an external REST service from a class.  
What REST client could I use?  
Does Elasticsearch have any integrated not-Elasticsearch-based REST client? E.g. `cxf-rt-rs-client`?

Thanks

---

<div class="post-metadata">

**Author:** ![rjernst](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rjernst/32/6363_2.png) [@rjernst](https://discuss.elastic.co/u/rjernst)\
**Post date:** [December 21, 2018, 7:35pm UTC](https://discuss.elastic.co/t/rest-client-to-call-external-service-in-a-elasticsearch-custom-plugin/161874/2 "2018-12-21T19:35:36Z")

</div>

Elasticsearch does not have a general purpose rest client: you would need to include this in your plugin. Additionally, be aware that your plugin should most likely make it's external calls in an async thread. This is really important to not block the networking threads for incoming requests.

---

<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:** [January 18, 2019, 7:35pm UTC](https://discuss.elastic.co/t/rest-client-to-call-external-service-in-a-elasticsearch-custom-plugin/161874/3 "2019-01-18T19:35:42Z")

</div>

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