public class ReducedPropagationManager extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
LOCK_REQUESTER |
static String |
MANAGER_QUEUE_PREFIX |
static String |
PROCESS_EXPIRED_QUEUES_LOCK |
static String |
PROCESSOR_ADDRESS |
| Constructor and Description |
|---|
ReducedPropagationManager(io.vertx.core.Vertx vertx,
ReducedPropagationStorage storage,
RequestQueue requestQueue,
org.swisspush.gateleen.core.lock.Lock lock) |
| Modifier and Type | Method and Description |
|---|---|
io.vertx.core.Future<Void> |
processIncomingRequest(io.vertx.core.http.HttpMethod method,
String targetUri,
io.vertx.core.MultiMap queueHeaders,
io.vertx.core.buffer.Buffer payload,
String queue,
long propagationIntervalMs,
io.vertx.core.Handler<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 propagationIntervalMs parameter
When the queue name is already in the storage, a running timer exists.
|
void |
startExpiredQueueProcessing(long intervalMs)
Start the periodic check to process expired queues.
|
public static final String PROCESS_EXPIRED_QUEUES_LOCK
public static final String LOCK_REQUESTER
public static final String PROCESSOR_ADDRESS
public static final String MANAGER_QUEUE_PREFIX
public ReducedPropagationManager(io.vertx.core.Vertx vertx,
ReducedPropagationStorage storage,
RequestQueue requestQueue,
org.swisspush.gateleen.core.lock.Lock lock)
public void startExpiredQueueProcessing(long intervalMs)
intervalMs - interval in millisecondspublic io.vertx.core.Future<Void> processIncomingRequest(io.vertx.core.http.HttpMethod method, String targetUri, io.vertx.core.MultiMap queueHeaders, io.vertx.core.buffer.Buffer payload, String queue, long propagationIntervalMs, io.vertx.core.Handler<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 namepropagationIntervalMs - the propagation interval in milliseconds 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.Copyright © 2016–2021. All rights reserved.