public class ReducedPropagationManager
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
LOCK_REQUESTER |
static java.lang.String |
MANAGER_QUEUE_PREFIX |
static java.lang.String |
PROCESSOR_ADDRESS |
| Constructor and Description |
|---|
ReducedPropagationManager(io.vertx.core.Vertx vertx,
ReducedPropagationStorage storage,
org.swisspush.gateleen.queue.queuing.RequestQueue requestQueue) |
| Modifier and Type | Method and Description |
|---|---|
io.vertx.core.Future<java.lang.Void> |
processIncomingRequest(io.vertx.core.http.HttpMethod method,
java.lang.String targetUri,
io.vertx.core.MultiMap queueHeaders,
io.vertx.core.buffer.Buffer payload,
java.lang.String queue,
long propagationInterval,
io.vertx.core.Handler<java.lang.Void> doneHandler)
The processing of incoming requests contains the following steps:
Lock the originally defined queue and enqueue the request
Add the queue name to the storage with an expiration value based on the propagationInterval parameter
When the queue name is already in the storage, a running timer exists.
|
void |
startExpiredQueueProcessing(long interval)
Start the periodic check to process expired queues.
|
public static final java.lang.String LOCK_REQUESTER
public static final java.lang.String PROCESSOR_ADDRESS
public static final java.lang.String MANAGER_QUEUE_PREFIX
public ReducedPropagationManager(io.vertx.core.Vertx vertx,
ReducedPropagationStorage storage,
org.swisspush.gateleen.queue.queuing.RequestQueue requestQueue)
public void startExpiredQueueProcessing(long interval)
interval - interval in millisecondspublic io.vertx.core.Future<java.lang.Void> processIncomingRequest(io.vertx.core.http.HttpMethod method,
java.lang.String targetUri,
io.vertx.core.MultiMap queueHeaders,
io.vertx.core.buffer.Buffer payload,
java.lang.String queue,
long propagationInterval,
io.vertx.core.Handler<java.lang.Void> doneHandler)
method - http method of the queued requesttargetUri - targetUri of the queued requestqueueHeaders - headers of the queued requestpayload - payload of the queued requestqueue - the queue namepropagationInterval - the propagation interval in seconds defining how long to prevent from propagating changes to the resourcedoneHandler - a handler which is called as soon as the request is written into the queue.