Class AuthorizationRetry

java.lang.Object
com.mulesoft.modules.agent.broker.internal.util.AuthorizationRetry

public class AuthorizationRetry extends Object
Utility class to handle retry logic for operations that may fail with 401 status code and return a retry-after header indicating when to retry the operation.
  • Constructor Details

    • AuthorizationRetry

      public AuthorizationRetry(org.mule.runtime.api.scheduler.SchedulerService schedulerService)
  • Method Details

    • executeWithRetry

      public <T> CompletableFuture<T> executeWithRetry(Supplier<CompletableFuture<T>> operation)
      Executes an operation with automatic retry logic for 401 responses with retry-after.
      Type Parameters:
      T - The type of the result
      Parameters:
      operation - A supplier that provides the CompletableFuture representing the operation to execute
      Returns:
      A CompletableFuture that completes with the result or exception