命令下发失败打印

This commit is contained in:
attiya 2025-11-18 14:12:57 +08:00
parent c3e586a62f
commit 0e8982ec3b

View File

@ -207,12 +207,12 @@ public class CommandServiceImpl implements CommandService {
// 发送消息到消息队列
sendMessageToQueue(topic, taskData);
// 等待结果5秒超时
// 等待结果10秒超时
return future.orTimeout(10, TimeUnit.SECONDS).join();
} catch (Exception e) {
pendingRequests.remove(taskId);
log.info("任务提交失败: {}", e.getMessage());
log.info("任务提交失败: {},任务标识: {}", e.getMessage(),taskId);
throw new EbikeException("超时未响应");
}
}
@ -221,7 +221,6 @@ public class CommandServiceImpl implements CommandService {
* 发送消息到消息队列
*/
private void sendMessageToQueue(String topic, String taskData) {
executor.submit(() -> kafkaProducer.send(topic, taskData));
}