Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
H
haikang-client
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
杨立
haikang-client
Commits
6ca4b983
提交
6ca4b983
authored
10月 18, 2021
作者:
wangqiang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
mqtt连不上的时候 启动优化
上级
c02c9795
隐藏空白字符变更
内嵌
并排
正在显示
8 个修改的文件
包含
56 行增加
和
50 行删除
+56
-50
MqttServiceImpl.java
...java/com/priusis/client/service/core/MqttServiceImpl.java
+16
-11
application.yml
apq-pc-client/src/main/resources/application.yml
+1
-1
apq-client.iss
tools/install-package/boot/apq-client/apq-client.iss
+1
-1
删除服务S.bat
tools/install-package/boot/apq-client/bak/删除服务S.bat
+11
-0
启动服务S.bat
tools/install-package/boot/apq-client/bak/启动服务S.bat
+8
-2
apq-pc-client-0.0.1-SNAPSHOT-boot.jar
.../apq-client/service/apq-pc-client-0.0.1-SNAPSHOT-boot.jar
+0
-0
删除服务.bat
tools/install-package/boot/apq-client/service/删除服务.bat
+8
-20
启动服务.bat
tools/install-package/boot/apq-client/service/启动服务.bat
+11
-15
没有找到文件。
apq-pc-client/src/main/java/com/priusis/client/service/core/MqttServiceImpl.java
浏览文件 @
6ca4b983
...
...
@@ -568,16 +568,17 @@ public class MqttServiceImpl implements MqttService, MqttHandler, MqttClientCall
log
.
debug
(
"try connect client"
);
connectTbClient
();
//tbClient.on(DEVICE_ATTRIBUTES_TOPIC, this).await(connection.getConnectionTimeout(), TimeUnit.MILLISECONDS);
tbClient
.
on
(
DEVICE_GET_ATTRIBUTES_RESPONSE_PLUS_TOPIC
,
this
).
await
(
connection
.
getConnectionTimeout
(),
TimeUnit
.
MILLISECONDS
);
tbClient
.
on
(
DEVICE_GET_ATTRIBUTES_RESPONSE_TOPIC
,
this
).
await
(
connection
.
getConnectionTimeout
(),
TimeUnit
.
MILLISECONDS
);
tbClient
.
on
(
DEVICE_RPC_TOPIC
,
this
).
await
(
connection
.
getConnectionTimeout
(),
TimeUnit
.
MILLISECONDS
);
byte
[]
msgData
=
toBytes
(
newNode
().
put
(
"sharedKeys"
,
"configuration"
));
persistMessage
(
DEVICE_GET_ATTRIBUTES_REQUEST_TOPIC
,
msgIdSeq
.
incrementAndGet
(),
msgData
,
null
,
error
->
log
.
warn
(
"Error getiing attributes"
,
error
));
if
(
tbClient
.
isConnected
())
{
//tbClient.on(DEVICE_ATTRIBUTES_TOPIC, this).await(connection.getConnectionTimeout(), TimeUnit.MILLISECONDS);
tbClient
.
on
(
DEVICE_GET_ATTRIBUTES_RESPONSE_PLUS_TOPIC
,
this
).
await
(
connection
.
getConnectionTimeout
(),
TimeUnit
.
MILLISECONDS
);
tbClient
.
on
(
DEVICE_GET_ATTRIBUTES_RESPONSE_TOPIC
,
this
).
await
(
connection
.
getConnectionTimeout
(),
TimeUnit
.
MILLISECONDS
);
tbClient
.
on
(
DEVICE_RPC_TOPIC
,
this
).
await
(
connection
.
getConnectionTimeout
(),
TimeUnit
.
MILLISECONDS
);
byte
[]
msgData
=
toBytes
(
newNode
().
put
(
"sharedKeys"
,
"configuration"
));
persistMessage
(
DEVICE_GET_ATTRIBUTES_REQUEST_TOPIC
,
msgIdSeq
.
incrementAndGet
(),
msgData
,
null
,
error
->
log
.
warn
(
"Error getiing attributes"
,
error
));
}
return
tbClient
;
}
catch
(
InterruptedException
e
)
{
log
.
error
(
e
.
getMessage
(),
e
);
...
...
@@ -603,7 +604,11 @@ public class MqttServiceImpl implements MqttService, MqttHandler, MqttClientCall
}
});
try
{
connectResult
.
get
(
connection
.
getConnectionTimeout
(),
TimeUnit
.
MILLISECONDS
);
MqttConnectResult
mqttConnectResult
=
connectResult
.
get
(
connection
.
getConnectionTimeout
(),
TimeUnit
.
MILLISECONDS
);
if
(!
mqttConnectResult
.
isSuccess
())
{
log
.
error
(
"Unable to sucess connect to mqtt server try again!"
);
tbClient
.
disconnect
();
}
}
catch
(
TimeoutException
e
)
{
log
.
error
(
"Unable to connect to mqtt server try again!"
);
String
message
=
"Unable to connect to Priusisiot. Connection timed out after ["
+
connection
.
getConnectionTimeout
()
+
"] milliseconds"
;
...
...
apq-pc-client/src/main/resources/application.yml
浏览文件 @
6ca4b983
...
...
@@ -25,7 +25,7 @@ core:
connection
:
host
:
"
${PC_HOST:127.0.0.1}"
port
:
"
${PC_PORT:1884}"
retryInterval
:
3
000
retryInterval
:
6
000
maxInFlight
:
1000
security
:
apiByMac
:
"
${PC_API_BY_MAC:true}"
...
...
tools/install-package/boot/apq-client/apq-client.iss
浏览文件 @
6ca4b983
...
...
@@ -4,7 +4,7 @@
#define MyAppName "阿普奇检测客户端"
#define MyAppVersion "V1.0"
#define MyAppPublisher "阿普奇"
#define MyAppURL "https://www.apq.com/"
#define MyAppURL "https://www.apq.com/"
#define MyAppDirName "apq-client"
#define MyAppEnName "apq-client"
#define MyAppExeName "apq-client.exe"
...
...
tools/install-package/boot/apq-client/bak/删除服务S.bat
浏览文件 @
6ca4b983
...
...
@@ -8,6 +8,16 @@ net stop apq-client-service
@ECHO Uninstalling apq-client-service ...
"%~dp0apq-client-service.exe" uninstall
@ECHO Stopping apq-other-service ...
net stop apq-control-service
net stop apq-info-service
net stop apq-register-service
@ECHO Uninstalling apq-other-service ...
sc delete apq-control-service
sc delete apq-info-service
sc delete apq-register-service
@ECHO DONE.
:END
\ No newline at end of file
tools/install-package/boot/apq-client/bak/启动服务S.bat
浏览文件 @
6ca4b983
...
...
@@ -2,11 +2,16 @@
setlocal ENABLEEXTENSIONS
@ECHO Installing apq-client ...
@ECHO Installing apq-client
-service
...
"%~dp0apq-client-service.exe" install
@ECHO running apq-client ...
@ECHO running apq-client
-service
...
"%~dp0apq-client-service.exe" start
@ECHO running apq-other-service ...
net start apq-control-service
net start apq-info-service
net start apq-register-service
@ECHO DONE.
:END
\ No newline at end of file
tools/install-package/boot/apq-client/service/apq-pc-client-0.0.1-SNAPSHOT-boot.jar
浏览文件 @
6ca4b983
This source diff could not be displayed because it is too large. You can
view the blob
instead.
tools/install-package/boot/apq-client/service/删除服务.bat
浏览文件 @
6ca4b983
@ECHO OFF
cd /d "%~dp0"
setlocal enabledelayedexpansion
@ECHO Stopping apq-client-service ...
net stop apq-client-service
@ECHO Uninstalling apq-client-service ...
"%~dp0apq-client-service.exe" uninstall
@ECHO Stopping apq-other-service ...
net stop apq-control-service
net stop apq-info-service
net stop apq-register-service
@ECHO Uninstalling apq-other-service ...
sc delete apq-control-service
sc delete apq-info-service
sc delete apq-register-service
for /F "TOKENS=1,2,*" %%b in ('tasklist /FI "IMAGENAME eq apq.exe"') do TASKKILL /F /PID %%b
taskkill -f -t -im %MyPID%
@ECHO DONE.
for /F "TOKENS=1,2,*" %%a in ('jps -m ^| findstr apq-pc-client') do set SPID=%%a
TASKKILL /F /PID %SPID%
:END
\ No newline at end of file
echo stop apq client service
exit
\ No newline at end of file
tools/install-package/boot/apq-client/service/启动服务.bat
浏览文件 @
6ca4b983
@ECHO OFF
cd /d "%~dp0"
::start xx.exe
setlocal enabledelayedexpansion
setlocal ENABLEEXTENSIONS
for /F "TOKENS=1,2,*" %%b in ('tasklist /FI "IMAGENAME eq apq.exe"') do TASKKILL /F /PID %%b
::taskkill -f -t -im %MyPID%
@ECHO Installing apq-client-service ...
"%~dp0apq-client-service.exe" install
@ECHO running apq-client-service ...
"%~dp0apq-client-service.exe" start
for /F "TOKENS=1,2,*" %%a in ('jps -m ^| findstr apq-pc-client') do set SPID=%%a
TASKKILL /F /PID %SPID%
@ECHO running apq-other-service ...
net start apq-control-service
net start apq-info-service
net start apq-register-service
@ECHO DONE.
:END
\ No newline at end of file
start ..\jre\bin\apq-client -Xms256m -Xmx256m -Dfile.encoding=utf-8 -jar "%~dp0\apq-pc-client-0.0.1-SNAPSHOT-boot.jar"
echo start apq client service
exit
\ No newline at end of file
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论