7.16.2 client esClient.shutdown(); not working

Open
#104 9 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
elasticsearch, java
Domain
api, backend

Research direction

Start with the connecting documentation linked in the issue and the client-lifecycle entry points shown in the snippet, especially ElasticsearchClient, ElasticsearchTransport, RestClientTransport, and esClient.shutdown(). Reproduce the compile failure with Elasticsearch 7.16.2, Elasticsearch 7.14.2, and Java 8, then compare the documented API with the actual client surface; done means the shutdown behavior and supported usage are clearly established.

Written by the indexing model from the issue text.

Description

Category: Enhancement
import co.elastic.clients.elasticsearch.ElasticsearchClient;
import co.elastic.clients.elasticsearch.core.search.Hit;
import co.elastic.clients.json.jackson.JacksonJsonpMapper;
import co.elastic.clients.transport.ElasticsearchTransport;
import co.elastic.clients.transport.rest_client.RestClientTransport;
import java.io.IOException;
import org.apache.http.HttpHost;
import org.elasticsearch.action.search.SearchResponse;
import org.elasticsearch.client.RestClient;

.....

RestClient restClient = RestClient.builder(new HttpHost("localhost", 9200)).build();

// Create the transport with a Jackson mapper
ElasticsearchTransport transport = new RestClientTransport(restClient, new JacksonJsonpMapper());
ElasticsearchClient esClient = new ElasticsearchClient(transport);

SearchResponse<Account> search = esClient.search(s
                -> s.index("account*")
                      .query(q -> q.term(t -> t.field("username").value(v -> v.stringValue("tmajer3")))),
                Account.class);

for (Hit<Account> hit : search.hits().hits()) {
            System.out.println(hit.source());
}
esClient.shutdown();
  • error:
never complite
Dominant language
Java
Stars
524
Forks
300
Avg merge
1d 11h
Merged PRs (30d)
16

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from elastic/elasticsearch-java

All issues in elastic/elasticsearch-java

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.