Commit 6330c793b85f4adf1f7ee278f716be1a37b40402
Exists in
master
and in
8 other branches
Merge remote-tracking branch 'origin/master'
Showing 2 changed files
platform-operate-api/src/main/resources/database.properties
View file @
6330c79
... | ... | @@ -7,4 +7,18 @@ |
7 | 7 | mongo.db.dbname=platform |
8 | 8 | mongo.db.username=root |
9 | 9 | mongo.db.password=root |
10 | + | |
11 | + | |
12 | +mongo.port=27017 | |
13 | +mongo.connectionsPerHost=8 | |
14 | +mongo.threadsAllowedToBlockForConnectionMultiplier=4 | |
15 | +mongo.connectTimeout=1000 | |
16 | +mongo.maxWaitTime=1500 | |
17 | +mongo.autoConnectRetry=true | |
18 | +mongo.socketKeepAlive=true | |
19 | +mongo.socketTimeout=1500 | |
20 | +mongo.slaveOk=true | |
21 | +mongo.username=*** | |
22 | +mongo.password=*** | |
23 | +mongo.dbname=platform |
platform-operate-api/src/main/resources/spring/spring-mongodb.xml
View file @
6330c79
... | ... | @@ -8,9 +8,31 @@ |
8 | 8 | |
9 | 9 | <mongo:db-factory id="mongoDbFactory" host="${mongo.db.host}" |
10 | 10 | port="${mongo.db.port}" dbname="${mongo.db.dbname}" /> |
11 | - | |
11 | + | |
12 | 12 | <bean id="mongoTemplate" class="org.springframework.data.mongodb.core.MongoTemplate"> |
13 | 13 | <constructor-arg name="mongoDbFactory" ref="mongoDbFactory" /> |
14 | + <!-- <constructor-arg name="userCredentials" ref="userCredentials"/> --> | |
14 | 15 | </bean> |
16 | + <!-- | |
17 | + <bean id="userCredentials" class="org.springframework.data.authentication.UserCredentials"> | |
18 | + <description>认证口令</description> | |
19 | + <constructor-arg name="username" value="${${mongo.username}}" /> | |
20 | + <constructor-arg name="password" value="${${mongo.password}}" /> | |
21 | + </bean> | |
22 | + | |
23 | + <mongo:mongo id="mongo" host="${${mongo.host}}" port="${${mongo.port}}"> | |
24 | + | |
25 | + <mongo:options connections-per-host="${${mongo.connectionsPerHost}}" | |
26 | + | |
27 | + threads-allowed-to-block-for-connection-multiplier="${${mongo.threadsAllowedToBlockForConnectionMultiplier}}" | |
28 | + | |
29 | + connect-timeout="${${mongo.connectTimeout}}" max-wait-time="${${mongo.maxWaitTime}}" | |
30 | + | |
31 | + auto-connect-retry="${${mongo.autoConnectRetry}}" socket-keep-alive="${${mongo.socketKeepAlive}}" | |
32 | + | |
33 | + socket-timeout="${${mongo.socketTimeout}}" slave-ok="${${mongo.slaveOk}}" | |
34 | + | |
35 | + write-number="1" write-timeout="0" write-fsync="true" /> | |
36 | + </mongo:mongo>--> | |
15 | 37 | </beans> |