public interface QueueCircuitBreaker
| Modifier and Type | Method and Description |
|---|---|
io.vertx.core.Future<Void> |
closeAllCircuits()
Closes all non-closed circuits.
|
io.vertx.core.Future<Void> |
closeCircuit(HttpRequest queuedRequest)
Closes the circuit representing the queued request.
|
io.vertx.core.Future<QueueCircuitState> |
handleQueuedRequest(String queueName,
HttpRequest queuedRequest)
Handles a queued request by checking the current
QueueCircuitState of the corresponding circuit. |
boolean |
isCircuitCheckEnabled()
Check whether the circuit check is enabled.
|
boolean |
isStatisticsUpdateEnabled()
Check whether the statistics update is enabled.
|
io.vertx.core.Future<Void> |
lockQueue(String queueName,
HttpRequest queuedRequest)
Locks the queue having the provided queueName by calling the vertx-redisques API.
|
io.vertx.core.Future<Void> |
reOpenCircuit(HttpRequest queuedRequest)
Re-Opens the (half-open) circuit representing the provided queued request again.
|
io.vertx.core.Future<Long> |
setOpenCircuitsToHalfOpen()
Changes the status of all circuits having a status equals
QueueCircuitState.OPEN
to QueueCircuitState.HALF_OPEN. |
io.vertx.core.Future<String> |
unlockNextQueue()
Unlocks the next queue in-line.
|
io.vertx.core.Future<String> |
unlockQueue(String queueName)
Unlocks the queue having the provided queueName by calling the vertx-redisques API.
|
io.vertx.core.Future<Long> |
unlockSampleQueues()
Unlocks a sample queue of all circuits having a status equals
QueueCircuitState.HALF_OPEN. |
io.vertx.core.Future<Void> |
updateStatistics(String queueName,
HttpRequest queuedRequest,
QueueResponseType queueResponseType)
Updates the statistics of the corresponding circuit based on the provided request to execute.
|
io.vertx.core.Future<QueueCircuitState> handleQueuedRequest(String queueName, HttpRequest queuedRequest)
QueueCircuitState of the corresponding circuit.
When the QueueCircuitState of the corresponding circuit equals QueueCircuitState.OPEN,
the provided queueName will be locked.queueName - the name of the queuequeuedRequest - the queued requestQueueCircuitState representing the current status of the circuitio.vertx.core.Future<Void> updateStatistics(String queueName, HttpRequest queuedRequest, QueueResponseType queueResponseType)
Updates the statistics of the corresponding circuit based on the provided request to execute.
Updating the statistics includes the following steps:
QueueResponseType.FAILUREQueueResponseType.SUCCESSqueueName - the name of the queuequeuedRequest - the queued requestqueueResponseType - the QueueResponseType representing the execution result of the queuedRequestboolean isCircuitCheckEnabled()
boolean isStatisticsUpdateEnabled()
io.vertx.core.Future<Void> lockQueue(String queueName, HttpRequest queuedRequest)
queueName - the name of the queuequeuedRequest - the queued requestio.vertx.core.Future<String> unlockQueue(String queueName)
queueName - the name of the queueio.vertx.core.Future<String> unlockNextQueue()
null
string in this case.null string
when no queue was available to unlock.io.vertx.core.Future<Void> closeCircuit(HttpRequest queuedRequest)
Closes the circuit representing the queued request.
Closing the circuit includes the following steps:
queuedRequest - the queued requestio.vertx.core.Future<Void> closeAllCircuits()
Closes all non-closed circuits.
Closing all non-closed circuits includes the following steps:
io.vertx.core.Future<Void> reOpenCircuit(HttpRequest queuedRequest)
queuedRequest - the queued requestio.vertx.core.Future<Long> setOpenCircuitsToHalfOpen()
QueueCircuitState.OPEN
to QueueCircuitState.HALF_OPEN.io.vertx.core.Future<Long> unlockSampleQueues()
QueueCircuitState.HALF_OPEN. The sample
queues are always the queues which have not been unlocked the longest.Copyright © 2016–2021. All rights reserved.