spring-info.xml
7.24 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
<?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:p="http://www.springframework.org/schema/p"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.1.xsd">
<bean id="dnsConfig" class="com.monitor.other.dns.common.DNSConfig">
<constructor-arg name="url" value="${dns.config.url}" />
<constructor-arg name="dnsApiUrl" value="${dns.config.api.url}" />
</bean>
<bean id="sheduletask" class="com.monitor.other.task.SheduleTask">
<property name="taskScheduler" ref="scheduler" />
</bean>
<!-- <bean id="maliciousIpJob" class="com.monitor.other.maliciousip.job.MaliciousIpJob"
init-method="init">
</bean>-->
<bean id="redisReadUtil" class="com.monitor.other.maliciousip.util.RedisReadUtil" />
<bean id="redisWriteUtil" class="com.monitor.other.maliciousip.util.RedisWriteUtil" />
<bean id="redisReadMaliciousUtil"
class="com.monitor.other.maliciousip.util.RedisReadMaliciousUtil" />
<!-- redis template definition -->
<bean id="stringRedisSerializer"
class="org.springframework.data.redis.serializer.StringRedisSerializer" />
<!-- pool config -->
<bean id="jedisPoolConfig" class="redis.clients.jedis.JedisPoolConfig">
<property name="maxTotal" value="${redis.pool.maxTotal:50}" />
<property name="maxIdle" value="${redis.pool.maxIdle:10}" />
<property name="minIdle" value="${redis.pool.minIdle:5}" />
<property name="maxWaitMillis" value="${redis.pool.maxWaitMillis:2000}" />
<property name="testOnBorrow" value="${redis.pool.testOnBorrow:false}" />
<property name="testWhileIdle" value="${redis.pool.testWhileIdle:false}" />
</bean>
<!-- aws 1 -->
<bean id="aws1JedisWriteConnectionFactory"
class="org.springframework.data.redis.connection.jedis.JedisConnectionFactory"
p:timeout="250" p:poolConfig-ref="jedisPoolConfig"
p:hostName="${malicious.ip.redis.write.aws.host1}" p:port="${malicious.ip.redis.write.port}"
p:password="${aws.redis.proxy.auth}" p:database="${aws.redis.proxy.database:0}"
primary="true" />
<bean id="aws1RedisWriteTemplate" primary="false"
class="org.springframework.data.redis.core.RedisTemplate"
p:connectionFactory-ref="aws1JedisWriteConnectionFactory"
p:keySerializer-ref="stringRedisSerializer" p:valueSerializer-ref="stringRedisSerializer"
p:hashKeySerializer-ref="stringRedisSerializer"
p:hashValueSerializer-ref="stringRedisSerializer" />
<!-- aws 2 -->
<bean id="aws2JedisWriteConnectionFactory"
class="org.springframework.data.redis.connection.jedis.JedisConnectionFactory"
p:timeout="250" p:poolConfig-ref="jedisPoolConfig"
p:hostName="${malicious.ip.redis.write.aws.host2}" p:port="${malicious.ip.redis.write.port}"
p:password="${aws.redis.proxy.auth}" p:database="${aws.redis.proxy.database:0}"
primary="true" />
<bean id="aws2RedisWriteTemplate" primary="false"
class="org.springframework.data.redis.core.RedisTemplate"
p:connectionFactory-ref="aws2JedisWriteConnectionFactory"
p:keySerializer-ref="stringRedisSerializer" p:valueSerializer-ref="stringRedisSerializer"
p:hashKeySerializer-ref="stringRedisSerializer"
p:hashValueSerializer-ref="stringRedisSerializer" />
<!-- qq 1 -->
<bean id="qq1JedisWriteConnectionFactory"
class="org.springframework.data.redis.connection.jedis.JedisConnectionFactory"
p:timeout="250" p:poolConfig-ref="jedisPoolConfig"
p:hostName="${malicious.ip.redis.write.qq.host1}" p:port="${malicious.ip.redis.write.port}"
p:password="${aws.redis.proxy.auth}" p:database="${aws.redis.proxy.database:0}"
primary="true" />
<bean id="qq1RedisWriteTemplate" primary="false"
class="org.springframework.data.redis.core.RedisTemplate"
p:connectionFactory-ref="qq1JedisWriteConnectionFactory"
p:keySerializer-ref="stringRedisSerializer" p:valueSerializer-ref="stringRedisSerializer"
p:hashKeySerializer-ref="stringRedisSerializer"
p:hashValueSerializer-ref="stringRedisSerializer" />
<!-- qq 2 -->
<bean id="qq2JedisWriteConnectionFactory"
class="org.springframework.data.redis.connection.jedis.JedisConnectionFactory"
p:timeout="250" p:poolConfig-ref="jedisPoolConfig"
p:hostName="${malicious.ip.redis.write.qq.host2}" p:port="${malicious.ip.redis.write.port}"
p:password="${aws.redis.proxy.auth}" p:database="${aws.redis.proxy.database:0}"
primary="true" />
<bean id="qq2RedisWriteTemplate" primary="false"
class="org.springframework.data.redis.core.RedisTemplate"
p:connectionFactory-ref="qq2JedisWriteConnectionFactory"
p:keySerializer-ref="stringRedisSerializer" p:valueSerializer-ref="stringRedisSerializer"
p:hashKeySerializer-ref="stringRedisSerializer"
p:hashValueSerializer-ref="stringRedisSerializer" />
<!-- spark read -->
<bean id="jedisReaderConnectionFactory"
class="org.springframework.data.redis.connection.jedis.JedisConnectionFactory"
p:timeout="250" p:poolConfig-ref="jedisPoolConfig" p:hostName="${malicious.ip.redis.read.host}"
p:port="${malicious.ip.redis.read.port}" p:password="${aws.redis.proxy.auth}"
p:database="${aws.redis.proxy.database:0}" primary="true" />
<bean id="redisReaderTemplate" primary="false"
class="org.springframework.data.redis.core.StringRedisTemplate"
p:connectionFactory-ref="jedisReaderConnectionFactory"
p:keySerializer-ref="stringRedisSerializer" p:valueSerializer-ref="stringRedisSerializer"
p:hashKeySerializer-ref="stringRedisSerializer"
p:hashValueSerializer-ref="stringRedisSerializer" />
<!-- 配置RestTemplate -->
<!--Http client Factory-->
<bean id="httpClientFactory" class="org.springframework.http.client.SimpleClientHttpRequestFactory">
<property name="connectTimeout" value="${connectTimeout}" />
<property name="readTimeout" value="${readTimeout}" />
</bean>
<!--RestTemplate-->
<bean id="restTemplate" class="org.springframework.web.client.RestTemplate">
<constructor-arg ref="httpClientFactory" />
<property name="messageConverters">
<list>
<bean class="org.springframework.http.converter.ByteArrayHttpMessageConverter" />
<bean class="org.springframework.http.converter.StringHttpMessageConverter">
<property name="supportedMediaTypes">
<list>
<value>text/plain;charset=UTF-8</value>
<value>text/html;charset=UTF-8</value>
<value>text/xml;charset=GBK</value>
<value>application/json;charset=UTF-8</value>
</list>
</property>
</bean>
<bean class="org.springframework.http.converter.ResourceHttpMessageConverter" />
<bean class="org.springframework.http.converter.FormHttpMessageConverter" />
<bean class="com.alibaba.fastjson.support.spring.FastJsonHttpMessageConverter">
<property name="supportedMediaTypes" value="application/json;charset=UTF-8" />
</bean>
</list>
</property>
</bean>
<!-- 配置RestTemplate -->
</beans>