diff --git a/ebike-operations/src/main/java/com/cdzy/operations/service/impl/CommandServiceImpl.java b/ebike-operations/src/main/java/com/cdzy/operations/service/impl/CommandServiceImpl.java index 1853d78..72202d0 100644 --- a/ebike-operations/src/main/java/com/cdzy/operations/service/impl/CommandServiceImpl.java +++ b/ebike-operations/src/main/java/com/cdzy/operations/service/impl/CommandServiceImpl.java @@ -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)); }