From b8ef27fef25aca82931610ead1573a0604684ccf Mon Sep 17 00:00:00 2001 From: linwl <304115325@qq.com> Date: Thu, 25 Feb 2021 08:51:33 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BC=80=E6=94=BE=E7=AB=AF=E5=8F=A3=E4=BF=A1?= =?UTF-8?q?=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/telpo/iotgateway/server/IotSubscribe.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/telpo/iotgateway/server/IotSubscribe.java b/src/main/java/com/telpo/iotgateway/server/IotSubscribe.java index c0ac59e..5b9cc5e 100644 --- a/src/main/java/com/telpo/iotgateway/server/IotSubscribe.java +++ b/src/main/java/com/telpo/iotgateway/server/IotSubscribe.java @@ -42,6 +42,9 @@ public class IotSubscribe { private long timeStamp; //签名方法:支持hmacmd5、hmacsha1和hmacsha256。 private String signMethod; + private String uId; + private String regionId; + private String productKey; private String clientId; private String iotHost; private String iotPort; @@ -65,6 +68,9 @@ public class IotSubscribe { this.iotInstanceId = environment.getProperty("iot.iotInstanceId"); //签名方法:支持hmacmd5、hmacsha1和hmacsha256。 this.signMethod = environment.getProperty("iot.signMethod"); + this.uId = environment.getProperty("iot.uId"); + this.regionId = environment.getProperty("iot.regionId"); + this.productKey = environment.getProperty("iot.productKey"); this.clientId = environment.getProperty("iot.clientId"); this.iotHost = environment.getProperty("iot.iotHost"); this.iotPort = environment.getProperty("iot.iotPort"); @@ -84,7 +90,8 @@ public class IotSubscribe { String password = doSign(signContent,accessSecret, signMethod); //接入域名,请参见AMQP客户端接入说明文档。 - String connectionUrl = "failover:(amqps://" + iotHost + ":" + iotPort + String host = uId + ".iot-amqp." + regionId + ".aliyuncs.com"; + String connectionUrl = "failover:(amqps://" + host + ":" + iotPort + "?amqp.idleTimeout=80000)" + "?failover.reconnectDelay=30";