Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Transport options set on the client builder drop SafeResponseConsumer

Aperta
#1,354 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

@RaphaelFakhri ci sta già lavorando.

Dal 19/10/2026.

  • #1355 di @RaphaelFakhri — aperta

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
54/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
java
Ambito
api, backend

Direzione di ricerca

Start by reading RestClientOptions.of(), Rest5ClientOptions.of(), and initialOptions() to trace how TransportOptions are converted; compare with the ElasticsearchClient.of(...) builder methods transportOptions(fn) and retryConfig(...). Check both the default and legacy transports against the expected safe consumer, then add or update tests showing that builder-configured options retain SafeResponseConsumer.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Java API client version

main (f920563)

Java version

21

Elasticsearch Version

Any (client-side)

Problem description

RestClientOptions.of() and Rest5ClientOptions.of() convert other TransportOptions implementations starting from RequestOptions.DEFAULT, while initialOptions() starts from SafeResponseConsumer.DEFAULT_REQUEST_OPTIONS. Converted options therefore lose SafeResponseConsumer.

The ElasticsearchClient.of(...) builder methods transportOptions(fn) and retryConfig(...) produce DefaultTransportOptions, so a client configured like this runs without the safe consumer:

ElasticsearchClient client = ElasticsearchClient.of(b -> b
    .host("http://localhost:9200")
    .transportOptions(o -> o.addHeader("Foo", "bar"))
);

Rest5ClientOptions options = (Rest5ClientOptions) client._transportOptions();
// Expected: SafeResponseConsumer.DEFAULT_FACTORY
// Actual:   HttpAsyncResponseConsumerFactory$BasicAsyncResponseConsumerFactory
System.out.println(options.restClientRequestOptions().getHttpAsyncResponseConsumerFactory());

The legacy transport (useLegacyTransport(true)) shows the same behavior with HeapBufferedResponseConsumerFactory. An Error thrown while consuming a response can then stop the I/O reactor, the failure that SafeResponseConsumer prevents (#1046).

Lingua principale
Java
Stelle
525
Fork
299
Merge medio
13h 9m
PR unite (30g)
5

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di elastic/elasticsearch-java

Tutte le issue di elastic/elasticsearch-java

Issue simili

Altre issue su Java

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.