# New elasticsearch-java client needs to initialize in springboot?

**URL:** <https://discuss.elastic.co/t/new-elasticsearch-java-client-needs-to-initialize-in-springboot/308451>\
**Category:** Elasticsearch\
**Tags:** language-clients\
**Created:** [June 29, 2022, 10:15am UTC](https://discuss.elastic.co/t/new-elasticsearch-java-client-needs-to-initialize-in-springboot/308451 "2022-06-29T10:15:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![the-worm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/the-worm/32/107663_2.png) [@the-worm](https://discuss.elastic.co/u/the-worm)\
**Post date:** [June 29, 2022, 10:15am UTC](https://discuss.elastic.co/t/new-elasticsearch-java-client-needs-to-initialize-in-springboot/308451/1 "2022-06-29T10:15:39Z")

</div>

Do we always need to initialize elasticsearch-java to use port 9200 or other custom ports and other setings?

Previous high level REST client(HLRC) does not need the initialization in springboot. You just declare it and you can use it right away.

Is this possible in the new es client

---

<div class="post-metadata">

**Author:** ![swallez](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/swallez/32/11972_2.png) [@swallez](https://discuss.elastic.co/u/swallez)\
**Post date:** [June 30, 2022, 8:05am UTC](https://discuss.elastic.co/t/new-elasticsearch-java-client-needs-to-initialize-in-springboot/308451/2 "2022-06-30T08:05:47Z")

</div>

elasticsearch-java and HLRC use the exact same lower-level client (LLRC) where host names and ports must be configured. So there must be some Spring magic involved that fetches those settings somewhere.

Can you provide a code snippet showing your HLRC injection? What SpringBoot modules are you using?

---

<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 28, 2022, 8:06am UTC](https://discuss.elastic.co/t/new-elasticsearch-java-client-needs-to-initialize-in-springboot/308451/3 "2022-07-28T08:06:31Z")

</div>

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