Skip to content

Replace hystrixruntimeexception in resilience4j #2060

Open
@rcbandit111

Description

@rcbandit111

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions