Browse Source

添加modbus接收数据的日志 2.在mongo连接上添加最大线程池数

master
zhizhi wu 4 years ago
parent
commit
afabab5de0
  1. 8
      ccmq/src/main/java/com/ccsens/ccmq/lowlevel/client/netty/tcphexserver/ModbusDecoder.java
  2. 2
      ccmq/src/main/resources/application-dev.properties
  3. 2
      ccmq/src/main/resources/application-prod.properties
  4. 5
      ccmq/src/main/resources/application-test.properties
  5. 2
      ccmq/src/main/resources/application-wiki.properties

8
ccmq/src/main/java/com/ccsens/ccmq/lowlevel/client/netty/tcphexserver/ModbusDecoder.java

@ -64,10 +64,12 @@ public class ModbusDecoder extends ByteToMessageDecoder {
CCModBusEntity ccModBusEntity = new CCModBusEntity(in);
// for (int i = 0; i < ccModBusEntity.getModbusData().length; i++) {
StringBuilder builder = new StringBuilder();
for (int i = 0; i < ccModBusEntity.getModbusData().length; i++) {
// log.info("modBus数据包:{}",ccModBusEntity.getModbusData()[i]);
// }
builder.append(String.format("%02x", ccModBusEntity.getModbusData()[i])).append(",");
}
log.info("‘{}", builder);
CCModBusEntity.Error error = ccModBusEntity.valid();
log.info("modBus数据检查:{}", error);
switch (error) {

2
ccmq/src/main/resources/application-dev.properties

@ -29,7 +29,7 @@ spring.rabbitmq.password=111111
# spring.rabbitmq.listener.simple.acknowledge-mode=manual
# MongoDB配置信息
spring.data.mongodb.uri=mongodb://wei:111111@49.233.89.188:27017/test
spring.data.mongodb.uri=mongodb://wei:111111@49.233.89.188:27017/test?maxPoolSize=1000
spring.data.mongodb.option.socket-timeout=5000
spring.data.mongodb.option.max-connection-idle-time=10000

2
ccmq/src/main/resources/application-prod.properties

@ -29,7 +29,7 @@ spring.rabbitmq.password=111111
# spring.rabbitmq.listener.simple.acknowledge-mode=manual
# MongoDB配置信息
spring.data.mongodb.uri=mongodb://wei:111111@127.0.0.1:27017/test
spring.data.mongodb.uri=mongodb://wei:111111@127.0.0.1:27017/test?maxPoolSize=1000
# 最大连接数,每一台服务器
spring.data.mongodb.option.max-connection-per-host=100

5
ccmq/src/main/resources/application-test.properties

@ -27,7 +27,7 @@ spring.rabbitmq.password=111111
# spring.rabbitmq.listener.simple.acknowledge-mode=manual
# MongoDB配置信息
spring.data.mongodb.uri=mongodb://wei:111111@49.233.89.188:27017/test
spring.data.mongodb.uri=mongodb://wei:111111@49.233.89.188:27017/test?maxPoolSize=1000
# 最大连接数,每一台服务器
spring.data.mongodb.option.max-connection-per-host=100
# 可阻塞线程队列容量
@ -45,7 +45,8 @@ spring.data.mongodb.option.socket-timeout=10000
spring.data.mongodb.option.socket-keep-alive=true
## 连接空闲时间8小时,否则连接太过频繁
spring.data.mongodb.option.max-connection-idle-time=28800000
#spring.data.mongodb.option.max-connection-idle-time=28800000
spring.data.mongodb.option.max-connection-idle-time=60000
spring.data.mongodb.option.max-connection-life-time=0
#心跳
spring.data.mongodb.option.heartbeat-socket-timeout=10000

2
ccmq/src/main/resources/application-wiki.properties

@ -26,7 +26,7 @@ spring.rabbitmq.username=yu
spring.rabbitmq.password=sd12345
# spring.rabbitmq.listener.simple.acknowledge-mode=manual
# MongoDB配置信息
spring.data.mongodb.uri=mongodb://yulei:sxwiki_mongo#@49.232.6.143:27017/test
spring.data.mongodb.uri=mongodb://yulei:sxwiki_mongo#@49.232.6.143:27017/test?maxPoolSize=1000
# 最大连接数,每一台服务器
spring.data.mongodb.option.max-connection-per-host=100
# 可阻塞线程队列容量

Loading…
Cancel
Save