public class RatelimiterOperations extends Object implements org.mule.runtime.api.lifecycle.Initialisable, org.mule.runtime.api.lifecycle.Disposable
| Modifier and Type | Class and Description |
|---|---|
class |
RatelimiterOperations.RetryAfterRunner
Schedulable execution to run the first and followup calls.
|
| Constructor and Description |
|---|
RatelimiterOperations() |
| Modifier and Type | Method and Description |
|---|---|
void |
dispose() |
void |
fixedDelay(long delay,
TimeUnit unit,
org.mule.runtime.extension.api.runtime.process.CompletionCallback<Void,Void> callback) |
void |
handleRetryAfter(org.mule.runtime.extension.api.runtime.route.Chain operations,
org.mule.runtime.extension.api.runtime.process.CompletionCallback<Object,Object> callback,
String id,
int numberOfRetries,
int waitStatusCode,
org.mule.runtime.extension.api.runtime.parameter.Literal<String> waitTimeExpression) |
void |
initialise() |
void |
limitRate(RatelimiterConfiguration configuration,
org.mule.runtime.extension.api.runtime.process.CompletionCallback<Void,Void> callback)
Delay the flow if called too fast.
|
org.mule.runtime.extension.api.runtime.operation.Result<Object,Object> |
setAttributes(Object payload,
Object attributes) |
public void initialise()
initialise in interface org.mule.runtime.api.lifecycle.Initialisablepublic void dispose()
dispose in interface org.mule.runtime.api.lifecycle.Disposable@Throws(value=BufferErrorProvider.class) public void limitRate(@Config RatelimiterConfiguration configuration, org.mule.runtime.extension.api.runtime.process.CompletionCallback<Void,Void> callback)
public void fixedDelay(long delay,
TimeUnit unit,
org.mule.runtime.extension.api.runtime.process.CompletionCallback<Void,Void> callback)
@OutputResolver(output=SetAttributesOutputResolver.class) public org.mule.runtime.extension.api.runtime.operation.Result<Object,Object> setAttributes(@Optional(defaultValue="#[payload]") Object payload, @Expression(value=REQUIRED) Object attributes)
@Alias(value="handle-429") @Throws(value=Handle429ErrorProvider.class) @MediaType(value="*/*") public void handleRetryAfter(org.mule.runtime.extension.api.runtime.route.Chain operations, org.mule.runtime.extension.api.runtime.process.CompletionCallback<Object,Object> callback, @Summary(value="Resource ID") String id, @Summary(value="How often shall the operation be retried when the first try failed?") int numberOfRetries, @Summary(value="Status code for wait") @Optional(defaultValue="429") int waitStatusCode, @Summary(value="A DataWeave expression to compute the time to wait (in milliseconds).The following predefined variable exist: headers: The HTTP response headers as mapretryIndex: Which try is this (counted from 0). ") @Optional(defaultValue="#[(headers.\"retry-after\" default \"0\" as Number) * 1000]") org.mule.runtime.extension.api.runtime.parameter.Literal<String> waitTimeExpression)
Copyright © 2023 MuleSoft, Inc.. All rights reserved.