Search in sources :

Example 1 with RequestResponseLoggingInterceptor

use of org.esupportail.papercut.services.RequestResponseLoggingInterceptor in project esup-papercut by EsupPortail.

the class RestConfig method restTemplate.

@Bean
public RestTemplate restTemplate() throws Exception {
    SimpleClientHttpRequestFactory requestFactory = new SimpleClientHttpRequestFactory();
    RestTemplate restTemplate = new RestTemplate(new BufferingClientHttpRequestFactory(requestFactory));
    restTemplate.setInterceptors(Collections.singletonList(new RequestResponseLoggingInterceptor()));
    restTemplate.getMessageConverters().add(0, jacksonConverter());
    return restTemplate;
}
Also used : SimpleClientHttpRequestFactory(org.springframework.http.client.SimpleClientHttpRequestFactory) RestTemplate(org.springframework.web.client.RestTemplate) RequestResponseLoggingInterceptor(org.esupportail.papercut.services.RequestResponseLoggingInterceptor) BufferingClientHttpRequestFactory(org.springframework.http.client.BufferingClientHttpRequestFactory) Bean(org.springframework.context.annotation.Bean)

Aggregations

RequestResponseLoggingInterceptor (org.esupportail.papercut.services.RequestResponseLoggingInterceptor)1 Bean (org.springframework.context.annotation.Bean)1 BufferingClientHttpRequestFactory (org.springframework.http.client.BufferingClientHttpRequestFactory)1 SimpleClientHttpRequestFactory (org.springframework.http.client.SimpleClientHttpRequestFactory)1 RestTemplate (org.springframework.web.client.RestTemplate)1