com.raynigon.ecs.logging.access.client.RestClientConfiguration Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ecs-logging-access Show documentation
Show all versions of ecs-logging-access Show documentation
The ecs-logging-access is a part of the unit-api
The newest version!
package com.raynigon.ecs.logging.access.client;
import jakarta.annotation.PostConstruct;
import lombok.RequiredArgsConstructor;
import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.web.client.RestClientCustomizer;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.HttpRequest;
import org.springframework.http.client.ClientHttpRequestExecution;
import org.springframework.web.client.RestClient;
import org.springframework.web.client.RestTemplate;
import java.util.List;
@Configuration
@AutoConfiguration
@RequiredArgsConstructor
@ConditionalOnClass(value = {RestClient.Builder.class})
public class RestClientConfiguration implements RestClientCustomizer {
@Override
public void customize(RestClient.Builder restClientBuilder) {
restClientBuilder.requestInterceptor((request, body, execution) -> {
new AccessLogHeaderFilter().accept(request.getHeaders());
return execution.execute(request, body);
});
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy