Pipe status (Available from version 4.0)

Pipe status

Pipe status is a mechanism to monitor the state of a pipe and temporary disable it if it is detected as not OK,  so that it doesn't brake or block other parts of the system. Use this mechanism when single pipes in error affects the over all performance of Pipes by blocking.


Pipe status is controlled by the implementation, representing a strategy for how to recover a non OK pipe.

Available implementations

Recovery retry means that pipe recovery is done by calling (“letting calls through”)  after a number of calls or a period of time. If a retry call is successful, pipe is recovered.

Default (“default”): No-op implementation. Always considers a pipe to be OK. This is the default behaviour and has the exact same behaviour as before pipe status was introduced.


Basic recovery retry (“basic”): Keeps track of how many times a broken pipe has been called and for how long. Checks if pipe has recovered by letting calls through based on configurable counter and interval (whichever comes first). Works on pipe instance (ie not aware of cluster or multiple pipe instances, works best in a single server/single pipes configuration).


Static recovery retry (“static”): Same as basic but keeps track of all pipe instances in a JVM. Requires some synchronization for thread safety that may impact performance.

Configuration

In the current version status is configured on a pipe. This mean you’ll have configure it on every pipe that should use it. This may change in the future.

Properties

Name Description

pipe_status_impl

Name of pipe status implementation (see above)

recovery_retry_threshold

Number of times a non OK pipe should be blocked before trying to recover (default: 25).

recovery_retry_interval

Interval in seconds a non OK pipe should be blocked before trying to recover (default: 60)

Note: Properties are status impl specific, but static and basic is configured in the same way.

Example

{
    "id" : "pipe-id",
    "config" : {
        "pipe_status_impl" : "basic",
        "recovery_retry_threshold" : "5",
        “recovery_retry_interval”: “10”
    }
}


The above configuration will, if a pipe returns failure, skip the next 4 calls or wait 10 secs before allowing pipe to receive calls again. If that call is successful, pipe is OK and all calls will be processed as usual, otherwise the next 4 calls will be skipped or wait another 10 secs.