Elasticsearch is built with known username & password and need to access with java api

I have built and up an elasticsearch on my computer. And set the

xpack.security.enabled: true
xpack.security.authc.api_key.enabled: true

to enable basic security. The elastic username password is also generated automatically.
Now I need to access the 127.0.0.1:9200 with java API, how can I do that? If any example or demo provided is better.

Welcome!

Have a look at:

And

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