package com.juick.server.configuration; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.http.client.SimpleClientHttpRequestFactory; import org.springframework.web.client.RestTemplate; import javax.inject.Inject; @Configuration public class ActivityPubClientConfig { @Inject ActivityPubClientErrorHandler activityPubClientErrorHandler; @Bean public RestTemplate apClient() { SimpleClientHttpRequestFactory requestFactory = new SimpleClientHttpRequestFactory(); requestFactory.setOutputStreaming(false); RestTemplate restTemplate = new RestTemplate(requestFactory); restTemplate.setErrorHandler(activityPubClientErrorHandler); return restTemplate; } }