Class AuthorizationRetry
java.lang.Object
com.mulesoft.modules.agent.broker.internal.util.AuthorizationRetry
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 Summary
ConstructorsConstructorDescriptionAuthorizationRetry(org.mule.runtime.api.scheduler.SchedulerService schedulerService) -
Method Summary
Modifier and TypeMethodDescription<T> CompletableFuture<T>executeWithRetry(Supplier<CompletableFuture<T>> operation) Executes an operation with automatic retry logic for 401 responses with retry-after.
-
Constructor Details
-
AuthorizationRetry
public AuthorizationRetry(org.mule.runtime.api.scheduler.SchedulerService schedulerService)
-
-
Method Details
-
executeWithRetry
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
-