Mqtt AWSIotDevice.get()永远挂起

Mqtt AWSIotDevice.get()永远挂起,mqtt,paho,aws-iot,Mqtt,Paho,Aws Iot,我在rest服务中调用此代码(在Spring引导服务器中实现) 第一次呼叫运行正常。 (客户端初始化正确,并且正确获取设备阴影状态) 当我第二次运行相同的服务时,代码device.get()只是挂起并永久挂起线程 我和你一起工作 com.amazonaws:aws物联网设备sdk java:1.3.6 org.eclipse.paho:org.eclipse.paho.client.mqttv3:1.2.2 这是我的代码: AWSIotMqttClient awsIotClient = awsI

我在rest服务中调用此代码(在Spring引导服务器中实现) 第一次呼叫运行正常。 (客户端初始化正确,并且正确获取设备阴影状态) 当我第二次运行相同的服务时,代码
device.get()
只是挂起并永久挂起线程

我和你一起工作

com.amazonaws:aws物联网设备sdk java:1.3.6

org.eclipse.paho:org.eclipse.paho.client.mqttv3:1.2.2

这是我的代码:

AWSIotMqttClient awsIotClient = awsIotService.initClient();
AWSIotDevice device = new AWSIotDevice(deviceName);
        try {
            awsIotClient.attach(device);

            if(awsIotClient.getConnectionStatus()== AWSIotConnectionStatus.DISCONNECTED) {
                awsIotClient.connect(5000,true);
            }
            // Retrieve updated document from the shadow
            String shadowState = device.get();  // =>Suspended

这是我的客户端连接代码:(已成功连接)

顺便说一句,第二次调用:
device.update(jsonState)


KeyStorePasswordPair pair = getKeyStorePasswordPair(certificateFile, privateKeyFile);
awsIotClient = new AWSIotMqttClient(clientEndpoint, clientId, pair.keyStore, pair.keyPassword);
awsIotClient.setKeepAliveInterval(60000);
awsIotClient.setNumOfClientThreads(5);
awsIotClient.setMaxConnectionRetries(5);