spring-config-javaserver.xml
2.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:task="http://www.springframework.org/schema/task"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-4.0.xsd http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task.xsd">
<bean id="javaapi_ConnectionManager" class="org.apache.http.impl.conn.PoolingHttpClientConnectionManager">
<property name="maxTotal" value="40" />
<property name="defaultMaxPerRoute" value="5" />
</bean>
<bean id="javaapi_httpClientBuilder" class="org.apache.http.impl.client.HttpClientBuilder"
factory-method="create">
<property name="connectionManager" ref="javaapi_ConnectionManager" />
</bean>
<bean id="javaapi_httpClient" factory-bean="javaapi_httpClientBuilder"
factory-method="build" />
<!-- -->
<bean id="javaapi_clientHttpRequestFactory"
class="org.springframework.http.client.HttpComponentsClientHttpRequestFactory">
<constructor-arg ref="javaapi_httpClient" />
<property name="connectTimeout" value="2000" />
<property name="readTimeout" value="2000" />
</bean>
<bean id="javaapiRestTemplate" class="org.springframework.web.client.RestTemplate">
<constructor-arg ref="javaapi_clientHttpRequestFactory" />
<property name="messageConverters">
<list>
<bean class="org.springframework.http.converter.StringHttpMessageConverter" />
<bean class="org.springframework.http.converter.xml.SourceHttpMessageConverter" />
<bean class="org.springframework.http.converter.FormHttpMessageConverter" />
<bean class="org.springframework.http.converter.json.MappingJackson2HttpMessageConverter" />
<bean class="org.springframework.http.converter.xml.MarshallingHttpMessageConverter" />
</list>
</property>
</bean>
</beans>