Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace hystrixruntimeexception in resilience4j #2060

Open
rcbandit111 opened this issue May 2, 2024 · 0 comments
Open

Replace hystrixruntimeexception in resilience4j #2060

rcbandit111 opened this issue May 2, 2024 · 0 comments

Comments

@rcbandit111
Copy link

I have this Hystrix code which I want to migrate to resilience4j:

  @ExceptionHandler(HystrixRuntimeException.class)
  public ResponseEntity<?> handleHystrixException(HystrixRuntimeException hystrixException) {

    if (HystrixRuntimeException.FailureType.TIMEOUT == hystrixException.getFailureType()) {
      return new InternalTimeoutException();
    }
  }

I tried this:

  @ExceptionHandler(HystrixRuntimeException.class)
  public ResponseEntity<?> handleHystrixException(HystrixRuntimeException hystrixException) {

    if (hystrixException.getCause().getCause() instanceof TimeoutException) {
      return new InternalTimeoutException();
    }
  }

I can't find how to replace HystrixRuntimeException in resilience4j. Do you know how it should be replaced?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant