micronaut-projects / micronaut-elasticsearch

Integration between Micronaut and Elasticsearch
Apache License 2.0
17 stars 16 forks source link

The client doesn't seem to be built with respect to the configured defaultHeaders. #198

Closed sulume closed 1 year ago

sulume commented 3 years ago

Thanks for reporting an issue, please review the task list below before submitting the issue. Your issue report will be closed if the issue is incomplete and the below tasks not completed.

NOTE: If you are unsure about something and the issue is more of a question a better place to ask questions is on Stack Overflow (https://stackoverflow.com/tags/micronaut) or Gitter (https://gitter.im/micronautfw/). DO NOT use the issue tracker to ask questions.

Task List

Steps to Reproduce

  1. set the property elasticsearch.defaultHeaders in the format that StringToHeaderConverter can convert
  2. somehow inspect defaultHeaders in either RestClient built, or sniff http headers sent.

Expected Behaviour

The provided RestClient and the RestClient in the provided RestHighLevelClient are built with defaultHeaders filled with the values specified by the property and send requests with the headers by default.

Actual Behaviour

It does not seem to take defaultHeaders specified by the property, although the value in DefaultElasticsearchConfigurationProperties#defaultHeaders is set as expected.

Environment Information

Example Application

None.

I think this could be fixed by making DefaultElasticsearchClientFactory#restClientBuilder() configure RestClientBuilder#setDefaultHeaders() using elasticsearchConfiguration.getDefaultHeaders() as explained in the official doc.

Thank you.

altro3 commented 3 years ago

224 Created pull request to fix this problem

guillermocalvo commented 1 year ago

Closed by https://github.com/micronaut-projects/micronaut-elasticsearch/pull/224