修改BUG

This commit is contained in:
孙小云 2025-12-18 19:56:07 +08:00
parent 8143acf453
commit 83fb34d384
3 changed files with 5 additions and 2 deletions

View File

@ -248,6 +248,9 @@ public class TransactionExecutor {
if (callbackConfig.matches(messageBody)) {
future.complete(InstructionResult.success(messageBody));
log.debug("收到匹配的回调消息: topic={}", callbackConfig.getTopic());
} else {
// 不匹配重置状态继续等待
callbackReceived.set(false);
}
}
},

View File

@ -135,7 +135,7 @@ public class SubCommandTest {
Thread.sleep(100);
response = "{\"result\":\"subSuccess\"}";
mqttCallbackRegistry.handleMessage("test/" + TEST_SN + "/response", response);
mqttCallbackRegistry.handleMessage("test/" + TEST_SN + "/response123", response);
log.info(">>> 模拟发送成功子指令方法回调: {}", response);
} catch (InterruptedException e) {

View File

@ -141,7 +141,7 @@ public class TestVendorConfig implements VendorConfig {
Transaction complexTransaction = new Transaction("复杂指令树", CommandType.ENTER_DRC_MODE)
.root(complexRoot)
.setTimeout(25000);
.setTimeout(10000);
transactionMap.put(CommandType.ENTER_DRC_MODE, complexTransaction);
// 9. 指令被拒绝 - canExecute返回false