Commit fdfe94c1 authored by yzm's avatar yzm

mqtt建金服务解决id 重复问题

parent 1d1a1f06
......@@ -76,12 +76,12 @@ public class MQTTSubsribe {
public MqttConnectOptions getMqttConnectOptions() {
this.mqttConnectOptions = new MqttConnectOptions();
this.mqttConnectOptions.setCleanSession(true);
if(!"".equals(username) ) {
this.mqttConnectOptions.setUserName(username);
}
if(!"".equals(password) ) {
this.mqttConnectOptions.setPassword(password.toCharArray());
}
// if(!"".equals(username) ) {
// this.mqttConnectOptions.setUserName(username);
// }
// if(!"".equals(password) ) {
// this.mqttConnectOptions.setPassword(password.toCharArray());
// }
this.mqttConnectOptions.setServerURIs(new String[]{url});
this.mqttConnectOptions.setConnectionTimeout(completionTimeout);
this.mqttConnectOptions.setKeepAliveInterval(2000);
......
package com.hzjt.controller;
import com.alibaba.fastjson.JSONObject;
import com.hzjt.domain.GoalStructureParam;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import java.util.Set;
/**
* 路由接口控制器
......
......@@ -23,26 +23,26 @@ public class DateUtils {
public static String getDateStringNoSign(Date date) {
SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMdd");
log.info("date timezone:{}",formatter.getTimeZone()) ;
// log.info("date timezone:{}",formatter.getTimeZone()) ;
formatter.setTimeZone(TimeZone.getTimeZone("Asia/Shanghai"));
log.info("date timezone:{}",formatter.getTimeZone()) ;
// log.info("date timezone:{}",formatter.getTimeZone()) ;
String dateString = formatter.format(date);
return dateString ;
}
public static String formatCurrDayNoSign() {
SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMdd");
log.info("date timezone:{}",formatter.getTimeZone()) ;
// log.info("date timezone:{}",formatter.getTimeZone()) ;
formatter.setTimeZone(TimeZone.getTimeZone("Asia/Shanghai"));
log.info("date timezone:{}",formatter.getTimeZone()) ;
// log.info("date timezone:{}",formatter.getTimeZone()) ;
String dateString = formatter.format(new Date());
return dateString ;
}
public static Date Parsedate(String datestr) {
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
log.info("date timezone:{}",formatter.getTimeZone()) ;
// log.info("date timezone:{}",formatter.getTimeZone()) ;
formatter.setTimeZone(TimeZone.getTimeZone("Asia/Shanghai"));
log.info("date timezone:{}",formatter.getTimeZone()) ;
// log.info("date timezone:{}",formatter.getTimeZone()) ;
try {
Date dateString = formatter.parse(datestr);
return dateString ;
......
......@@ -21,7 +21,7 @@ logging.level.com.hzjt=debug
#spring.datasource.url=jdbc:oracle:thin:@192.168.168.212:1521:helowin
spring.datasource.username=hzjt
spring.datasource.password=hzjt
spring.datasource.url=jdbc:oracle:thin:@33.65.219.103:1521:helowin
spring.datasource.url=jdbc:oracle:thin:@33.65.250.179:1521:helowin
spring.datasource.driverClassName=oracle.jdbc.OracleDriver
# druid
spring.datasource.type=com.alibaba.druid.pool.DruidDataSource
......@@ -42,7 +42,7 @@ spring.datasource.connectionProperties=druid.stat.mergeSql=true;druid.stat.slowS
spring.datasource.useGlobalDataSourceStat=true
#redis
spring.redis.host=33.65.219.103
spring.redis.host=33.65.250.179
#spring.redis.host=127.0.0.1
spring.redis.port=6379
#spring.redis.password=123456
......@@ -53,14 +53,14 @@ spring.redis.pool.max-idle=8
spring.redis.pool.min-idle=0
spring.redis.timeout=2000
spring.session.store-type=none
ip.host=33.65.219.103
ip.host=33.65.250.179
port=21
message.dept=33030
message.rate=10
ftp.host=33.65.219.40:21:hzjt:1qaz2wsx
ftppath=hzjt:1qaz2wsx@33.65.219.40:21
ftpServiceUrl=http://33.65.219.103:8089/api/alg/files
ftpServiceUrl=http://33.65.250.179:8089/api/alg/files
alarm.subscribe.data.key=gs:traff:alarmlist
spring.jackson.date-format=yyyy-MM-dd HH:mm:ss
......@@ -81,7 +81,7 @@ mybatis.mapper-locations=classpath:mapper/*.xml
spring.mvc.throw-exception-if-no-handler-found=true
spring.resources.add-mappings=true
gs.traff.cloud.web.fileagent.url=ftp://hzjt:1qaz2wsx@33.65.219.103:21/gstraff/
gs.traff.cloud.web.fileagent.url=ftp://hzjt:1qaz2wsx@33.65.250.179:21/gstraff/
jms.queueName=demo_queue
alarmrecord.check.push.enable=1
alarmrecord.check.push.recordtype=1
......@@ -95,11 +95,11 @@ qingzhi.login.keepaliveurl=http://33.50.1.213:38080/api/auth/token/keepalive
#mqtt配置 - start
#用户名
spring.mqtt.username =cico
spring.mqtt.username =
#密码
spring.mqtt.password =cico@123
spring.mqtt.password =
#服务器连接地址
spring.mqtt.url = tcp://33.65.219.23:1883
spring.mqtt.url = tcp://12.1.97.11:1883
#连接超时
spring.mqtt.completionTimeout=3000
spring.mqtt.qos=2
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment