✅ 타임아웃을 걸기 위해 Duration을 사용해서 시간을 가져왔는데 에러 발생
int timeoutValue = timeout.getNano();
Spring HttpComponentsClientHttpRequestFactory setXXTimeout(int timeout)은 int 타입Duration.ofSeconds(x).getNano()를 사용하여 값을 설정하면서 문제가 발생getNano()인 경우 toMillis() 단위로 변환이 필요int timeoutValue = Math.toIntExact(timeout.toMillis());
long bigValue = 2147483648L; // int 범위를 초과
int intValue = Math.toIntExact(bigValue); // ArithmeticException
Long 과 int의 최대값이 다르기 때문에 형변환 시 오버플로우 발생 가능Math.toIntExact는 오버플로우 발생 시 런타임 예외를 주기 때문에 필수