public class RatelimiterOperations extends Object implements org.mule.runtime.api.lifecycle.Startable, org.mule.runtime.api.lifecycle.Stoppable
| 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 |
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,
org.mule.runtime.extension.api.runtime.parameter.Literal<String> joinWaitTimeExpression) |
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) |
void |
start() |
void |
stop() |
public void start()
start in interface org.mule.runtime.api.lifecycle.Startablepublic void stop()
stop in interface org.mule.runtime.api.lifecycle.Stoppable@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?") @Optional(defaultValue="5") 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 values are available: headers: The HTTP response headers as mapretryIndex: Which retry attemt is this (first retry: 1). ") @Optional(defaultValue="#[(headers.\"retry-after\" default \"0\" as Number + random() * 100) * 1000]") org.mule.runtime.extension.api.runtime.parameter.Literal<String> waitTimeExpression, @Summary(value="Additional wait time when joining an already active wait (in milliseconds).") @Optional(defaultValue="#[100 + random() * 1000]") org.mule.runtime.extension.api.runtime.parameter.Literal<String> joinWaitTimeExpression)
Copyright © 2023 MuleSoft, Inc.. All rights reserved.