Skip to content

Improve client configuration callbacks #1930

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

Merged

Conversation

sothawo
Copy link
Collaborator

@sothawo sothawo commented Sep 10, 2021

Client configuration:

        @Bean
	public ClientConfiguration clientConfiguration() {
		return ClientConfiguration.builder() //
			.connectedTo("localhost:9200") //
			.withClientConfigurer(ReactiveRestClients.WebClientConfigurationCallback.from(webClient -> {
				// will be called when a reactive client is created
				return webClient;
			}))
			.withClientConfigurer(ReactiveRestClients.WebClientConfigurationCallback.from(webClient -> {
				// will also be called when a reactive client is created
				return webClient;
			}))
			.withClientConfigurer(RestClients.RestClientConfigurationCallback.from(clientBuilder -> {
				// will be called when an imperative client is created
				return clientBuilder;
			}))
			.build();
	}

Closes #1929

@sothawo sothawo merged commit 8ab84fc into spring-projects:main Sep 10, 2021
@sothawo sothawo deleted the improve-client-configuration-callbacks branch September 11, 2021 07:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve client configuration callback setup
1 participant