WildFly: MicroProfile Health

Parent POM for JBoss projects. Provides default project build configuration.

Лицензия

Лицензия

Категории

Категории

WildFly Контейнер Application Servers
Группа

Группа

org.wildfly
Идентификатор

Идентификатор

wildfly-microprofile-health
Последняя версия

Последняя версия

1.0.0
Дата

Дата

Тип

Тип

zip
Описание

Описание

WildFly: MicroProfile Health
Parent POM for JBoss projects. Provides default project build configuration.
Организация-разработчик

Организация-разработчик

JBoss by Red Hat
Система контроля версий

Система контроля версий

https://github.com/jmesnil/wildfly-microprofile-health

Скачать wildfly-microprofile-health

Зависимости

Библиотека не имеет зависимостей. Это самодостаточное приложение, которое не зависит ни от каких других библиотек.

Модули Проекта

  • extension
  • feature-pack
  • dist
  • tck
  • examples

wildfly-microprofile-health

WildFly Extension for Eclipse MicroProfile Health.

Instructions

mvn clean install

Project structure

  • extension - WildFly Extension that provides the microprofile-health subsystem.
  • feature-pack - Feature pack that bundles the extension with the JBoss Modules required to run it in WildFly.
  • dist - A distribution of WildFly with the microprofile-health extension installed (in its standalone-microprofile.xml configuration)
  • examples - Examples of an applications that provides Health Check Procedures

Usage

Start WildFly with the microprofile-health extension installed:

$> export JBOSS_HOME=dist/target/microprofile-health-x-x-x
$> cd $JBOSS_HOME
$> ./bin/standalone.sh -c standalone-microprofile.xml
...
13:45:33,808 INFO  [org.wildfly.extension.microprofile.health] (ServerService Thread Pool -- 47) EMPHEALTH0001: Activating Eclipse MicroProfile Health Subsystem
...
13:45:35,010 INFO  [org.jboss.as] (Controller Boot Thread) WFLYSRV0025: WildFly Core 3.0.0.Beta11 "Kenny" started in 3507ms - Started 246 of 292 services (88 services are lazy, passive or on-demand)

You can perform a health check using WildFly CLI Console by invoking the /subsystem=microprofile-health:check operation


$> $JBOSS_HOME/bin/jboss-cli.sh -c
[standalone@localhost:9990 /] /subsystem=microprofile-health:check
{
    "outcome" => "success",
    "result" => {
        "checks" => [{
            "id" => "heap-memory",
            "result" => "UP",
            "data" => {
                "max" => "477626368",
                "used" => "156216336"
            }
        }],
        "outcome" => "UP"
    }
}

Alternatively, you can use HTTP to perform a health check using the URL http://localhost:8080/health/:

{
   "checks":[
      {
         "id":"heap-memory",
         "result":"UP",
         "data":{
            "max":"477626368",
            "used":"160137128"
         }
      }
   ],
   "outcome":"UP"
}

If you now deploy the demo.war (from the examples/simple directory), its health check procedures will also be taken into account to determine the overal healthiness of the server:

$> $JBOSS_HOME/bin/jboss-cli.sh -c
[standalone@localhost:9990 /] deploy $WORKDIR/wildfly-microprofile-health/examples/simple/target/demo.war

You go again to http://localhost:8080/health/, you will see that the outcome will be down when the random health check procedure defined by the Web application is (randomly) down:

{
   "checks":[
      {
         "id":"heap-memory",
         "result":"UP",
         "data":{
            "max":"477626368",
            "used":"174963568"
         }
      },
      {
         "id":"random",
         "result":"DOWN",
         "data":{
            "foo":"bar"
         }
      }
   ],
   "outcome":"DOWN"
}

Note that when the overall outcome is down, the HTTP returns a 503 Service Unavailable status code along with the JSON payload. If the overall outome is down, the returned status code in in the 20x range.

Links

Версии библиотеки

Версия
1.0.0