|
1 | 1 | /* |
2 | | - * Copyright 2014-2018 the original author or authors. |
| 2 | + * Copyright 2014-2019 the original author or authors. |
3 | 3 | * |
4 | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
5 | 5 | * you may not use this file except in compliance with the License. |
|
46 | 46 | import org.springframework.context.annotation.Conditional; |
47 | 47 | import org.springframework.context.annotation.Configuration; |
48 | 48 | import org.springframework.context.annotation.Primary; |
49 | | -import org.springframework.http.client.SimpleClientHttpRequestFactory; |
50 | | -import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter; |
51 | 49 |
|
52 | 50 | import static org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication.Type; |
53 | 51 |
|
@@ -107,13 +105,9 @@ public ApplicationFactory applicationFactory(InstanceProperties instance, |
107 | 105 |
|
108 | 106 | @Bean |
109 | 107 | @ConditionalOnMissingBean |
110 | | - public ApplicationRegistrator registrator(ClientProperties client, |
111 | | - ApplicationFactory applicationFactory, |
112 | | - RestTemplateBuilder restTemplBuilder) { |
113 | | - RestTemplateBuilder builder = restTemplBuilder.messageConverters(new MappingJackson2HttpMessageConverter()) |
114 | | - .requestFactory(SimpleClientHttpRequestFactory.class) |
115 | | - .setConnectTimeout(client.getConnectTimeout()) |
116 | | - .setReadTimeout(client.getReadTimeout()); |
| 108 | + public ApplicationRegistrator registrator(ClientProperties client, ApplicationFactory applicationFactory) { |
| 109 | + RestTemplateBuilder builder = new RestTemplateBuilder().setConnectTimeout(client.getConnectTimeout()) |
| 110 | + .setReadTimeout(client.getReadTimeout()); |
117 | 111 | if (client.getUsername() != null) { |
118 | 112 | builder = builder.basicAuthentication(client.getUsername(), client.getPassword()); |
119 | 113 | } |
|
0 commit comments