# Xpack with elasticsearch java rest client

**URL:** <https://discuss.elastic.co/t/xpack-with-elasticsearch-java-rest-client/160379>\
**Category:** Elasticsearch\
**Created:** [December 11, 2018, 12:48pm UTC](https://discuss.elastic.co/t/xpack-with-elasticsearch-java-rest-client/160379 "2018-12-11T12:48:33Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![utkarsh](https://avatars.discourse-cdn.com/v4/letter/u/e9bcb4/32.png) [@utkarsh](https://discuss.elastic.co/u/utkarsh)\
**Post date:** [December 11, 2018, 12:48pm UTC](https://discuss.elastic.co/t/xpack-with-elasticsearch-java-rest-client/160379/1 "2018-12-11T12:48:34Z")

</div>

Updating elastic to 5.x from 2.x needs shield security to be replaced with x-pack security and java Transport client with java Rest-High-Level client/Low-Level-Client.  
Where can i find the information on how to use xpack with elasticsearch java rest client for version 5.6.2 and If no such information is present then how do i do it?(Because earlier I was providing shield username and password to java Transport client in my code and now with java Rest client coming into picture, i am not able to figure it out ) Plzz help 🙂

---

<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:** [December 11, 2018, 1:29pm UTC](https://discuss.elastic.co/t/xpack-with-elasticsearch-java-rest-client/160379/2 "2018-12-11T13:29:02Z")

</div>

This? [https://www.elastic.co/guide/en/elasticsearch/client/java-rest/5.6/\_basic\_authentication.html](https://www.elastic.co/guide/en/elasticsearch/client/java-rest/5.6/_basic_authentication.html)

---

<div class="post-metadata">

**Author:** ![TimV](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/timv/32/13162_2.png) [@TimV](https://discuss.elastic.co/u/TimV)\
**Post date:** [December 12, 2018, 4:38am UTC](https://discuss.elastic.co/t/xpack-with-elasticsearch-java-rest-client/160379/3 "2018-12-12T04:38:35Z")

</div>

> [@utkarsh](#):
>
> java Transport client with java Rest-High-Level client/Low-Level-Client.

Transport client is still supported in 5.x (and 6.x, but deprecated in 7.x) - is there a specific reason why you are switching to the Rest client?  
You can do so, but you are not required to.

---

<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 9, 2019, 4:52am UTC](https://discuss.elastic.co/t/xpack-with-elasticsearch-java-rest-client/160379/4 "2019-01-09T04:52:38Z")

</div>

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