![image](https://user-images.githubusercontent.com/42512469/190078802-e1818b47-5905-4452-86cf-25ce70b4174f.png)


![image](https://user-images.githubusercontent.com/42512469/190079027-44af1591-cc7b-4149-ba93-ffbbef238038.png)

}
        return timeout;
    }
    public static long getTimeout(URL url, String methodName, RpcContext context, long defaultTimeout) {
        long timeout = defaultTimeout;
        Object genericTimeout = context.getObjectAttachment(TIMEOUT_KEY);
        if (genericTimeout != null) {
            timeout = convertToNumber(genericTimeout, defaultTimeout);
        } else if (url != null) {
            timeout = url.getMethodPositiveParameter(methodName, TIMEOUT_KEY, defaultTimeout);
        }
        return timeout;
    }
    private static long convertToNumber(Object obj, long defaultTimeout) {
        long timeout = 0;
        try {
            if (obj instanceof String) {
                timeout = Long.parseLong((String) obj);
            } else if (obj instanceof Number) {
                timeout = ((Number) obj).longValue();
            } else {
                timeout = Long.parseLong(obj.toString());
            }
        } catch (Exception e) {
            
        }
        return timeout;
    }
}