Sign inSign up

jforge/unresponsive-app

By jforge

•Updated almost 5 years ago

Image
0

1.0K

jforge/unresponsive-app repository overview

Quality Gate Status Actions Status

⁠The Unresponsive App

Simple Node.js application NOT responding to any TCP request (except for the HTTP maintenance endpoints).

This application is used as a system test helper for circuit breaker scenarios in real environments. Although it is meant as an HTTP application, 'unresponsitivity' can as well be tested with any TCP-based protocol (requires Node v6 or higher).

⁠Startup

Run docker with

docker run -p 8080:8095 docker.pkg.github.com/jforge/docker-nodejs-unresponsive-app/unresponsive-webapp:v-1572443441

This project matches requirements for a Docker Hub Automated Build, e.g. https://hub.docker.com/r/jforge/unresponsive-app/⁠

A corresponding Docker image can be used e.g. for a AWS EC2 Container deployment to get a public available "unresponsive" application very quickly, e.g. http://..compute.amazonaws.com/manage/health

⁠API

Default behaviour is "unresponsive". The server then never responds except for the health checks and responsive switch.

HTTP-GET for the switches is just used for convenience and does not follow any REST-oriented approach (sorry).

Available HTTP requests:

HTTP methodUriResponseDescription
HEAD*200Returns empty, if head request is not blocked
OPTIONS*200Returns with options response headers, if not blocked
GET/manage/health200Returns health and responsivity status
GET/api/health200Returns health and responsivity status
GET/manage/set_responsive200Sets the behaviour to "responsive"
GET/manage/set_unresponsive200Sets the behaviour to "unresponsive"
GET/manage/method/head/allow200Allows HEAD requests (default)
GET/manage/method/head/block200Blocks HEAD requests
GET/manage/method/options/allow200Allows OPTIONS requests (default)
GET/manage/method/options/block200Blocks OPTIONS requests
GET, POST/any/other/urinone (timeout)Server does not answer with (default) mode "unresponsive"
GET, POST/any/other/uri200Server returns always with 200 with mode "responsive"

"Unresponsive" := the server doesn't answer at all, if using

"Allows/Blocks" : = the server allows or blocks requests with the particular http method.

⁠Manage Response Payload

The above-mentioned /manage methods answer with OK-health and the current (global) responsivity setting.

The values for the http method HEAD and OPTIONS are displayed accordingly.

{ 
  "status": "OK",
  "responsivity": "unresponsive",
  "HEAD" : "allowed",
  "OPTIONS": "allowed"
}
⁠Response in "responsive" mode

If the server is set to "responsive", any Uri request but the above-mentioned /api/health and /manage methods causes an HTTP 200-OK response together with a payload containing the requested resource.

{
  "status": "OK",
  "requestUri": "/any/other/uri"
}

Tag summary

Content type

Image

Digest

Size

22.5 MB

Last updated

almost 5 years ago

docker pull jforge/unresponsive-app