public static Long acquireLatchWaitTime()

in core/src/main/java/com/alibaba/smart/framework/engine/util/ParallelGatewayUtil.java [24:43]


    public static Long acquireLatchWaitTime(ExecutionContext context, Map<String, String> properties) {
        Long latchWaitTime = null;

        // 优先从并行网关属性上获取等待超时时间
        String waitTimeout = (String) MapUtil.safeGet(properties, ParallelGatewayConstant.WAIT_TIME_OUT);
        if (StringUtil.isNotEmpty(waitTimeout)) {
            try {
                latchWaitTime = Long.valueOf(waitTimeout);
            } catch (NumberFormatException e) {
                throw new EngineException("latchWaitTime type should be Long");
            }
        }

        // 如果网关属性上未配置超时时间,或格式非法。兜底从request上下文中获取配置
        if (null == latchWaitTime || latchWaitTime <= 0) {
            latchWaitTime = (Long) MapUtil.safeGet(context.getRequest(),
                    RequestMapSpecialKeyConstant.LATCH_WAIT_TIME_IN_MILLISECOND);
        }
        return latchWaitTime;
    }