public Mono<String> getNodeIdByUserIdAndDeviceType(
            @NotNull Long userId,
            @NotNull @ValidDeviceType DeviceType deviceType) {
        try {
            Validator.notNull(userId, "userId");
            Validator.notNull(deviceType, "deviceType");
            DeviceTypeUtil.validDeviceType(deviceType);
        } catch (ResponseException e) {
            return Mono.error(e);
        }
        return getUserSessionsStatus(userId).flatMap(sessionsStatus -> {
            String nodeId = sessionsStatus.getNodeIdIfActive(deviceType);
            return nodeId == null
                    ? Mono.empty()
                    : Mono.just(nodeId);
        });
    }
Note that both online and offline information will be cached
turms-server-common/src/main/java/im/turms/server/common/domain/session/service/UserStatusService.java