docs: add detailed 32960 pipeline comments
This commit is contained in:
@@ -11,4 +11,5 @@ import org.springframework.web.servlet.DispatcherServlet;
|
||||
@ConditionalOnProperty(prefix = "lingniu.ingest.command-gateway", name = "enabled", havingValue = "true", matchIfMissing = true)
|
||||
@ComponentScan(basePackageClasses = TerminalCommandController.class)
|
||||
public class CommandGatewayAutoConfiguration {
|
||||
// 只扫描 REST 下行命令网关;不参与 32960 接收、RAW 冷存或历史查询链路。
|
||||
}
|
||||
|
||||
@@ -205,12 +205,14 @@ public class TerminalCommandController {
|
||||
// ===== helpers =====
|
||||
|
||||
private Optional<DeviceSession> resolveSession(String clientId) {
|
||||
// 运维侧常拿到 VIN、手机号或 sessionId 中任意一个;这里按三索引兜底解析到在线连接。
|
||||
return sessions.findBySessionId(clientId)
|
||||
.or(() -> sessions.findByPhone(clientId))
|
||||
.or(() -> sessions.findByVin(clientId));
|
||||
}
|
||||
|
||||
private CommandResult awaitSync(String clientId, Jt808Commands.DownlinkCommand cmd, String op) {
|
||||
// 需要终端应答的命令走 request-response,超时时间由网关统一兜底,避免 HTTP 线程无限等待。
|
||||
CompletableFuture<Jt808Message> future =
|
||||
dispatcher.request(clientId, cmd, Jt808Message.class, DEFAULT_TIMEOUT);
|
||||
try {
|
||||
@@ -229,6 +231,7 @@ public class TerminalCommandController {
|
||||
|
||||
private CommandResult fireAndForget(String clientId, Jt808Commands.DownlinkCommand cmd, String op) {
|
||||
try {
|
||||
// ACK 类命令不等待终端回包;只确认写入在线 session 对应的 channel。
|
||||
dispatcher.notify(clientId, cmd).join();
|
||||
return CommandResult.ok(Map.of("op", op));
|
||||
} catch (Exception e) {
|
||||
|
||||
Reference in New Issue
Block a user