-
Notifications
You must be signed in to change notification settings - Fork 41.2k
Provide a configuration property for Elasticsearch path prefix #25010
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
If we need a new property, we need to consider #23106. |
We'll either add a property when we look at #23106 or we might consider adding a |
On the imperative side, the path prefix can be configured using a |
Elasticsearch's REST client does not appear to support this. The URIs are used to create |
Agreed. The only reason why I proposed that first solution was because in our application-dev.yml I was pointing either to a local ES instance (without path prefix) or to a test ES instance (with path prefix), but that's too much of a niche problem (and a non-standard one at that, I've created a separate test profile with its application-test.yml since), a simple path-prefix property will work. |
Customizer would be great. Currently just trying to add some request interceptors to do some signing (needed for AWS Elasticsearch Service). Currently hairy to extend the AbstractReactiveElasticsearchConfiguration class and then have to call the public method of ReactiveElasticsearchRestClientAutoConfiguration to get the standard setup to still run without copy-pasting. |
@AlexeiZenin Please open a separate issue for providing a customizer on the reactive side that shows your current approach. I'd like to see it to understand if a callback that is passed the |
Uh oh!
There was an error while loading. Please reload this page.
As of Spring Boot 2.4.2, with spring-data if the ES server is behind a reverse proxy with a prefix, there's no way to use Spring Boot's autoconfiguration for spring.elasticsearch.rest or spring.data.elasticsearch.client.reactive properties. One has to use the AbstractElasticsearchConfiguration in order to use the
ClientConfiguration.builder().withPathPrefix(prefix)
. The horror.Ideally, we could:
spring.data.elasticsearch.client.reactive.endpoints
, as it only uses ahost:port
format.path-prefix
in aspring.elasticsearch.rest.path-prefix
orspring.data.elasticsearch.client.reactive.path-prefix
property. In that case, it would behave like thewithPathPrefix(String)
method, applying the prefix to all the uris/endpoints in the listThe text was updated successfully, but these errors were encountered: