Skip to content

Commit

Permalink
Upgrade MP Health to 3.1 and SR Health to 3.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
xstefank authored and gsmet committed Jun 28, 2021
1 parent 049068b commit d767e4c
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 2 deletions.
2 changes: 1 addition & 1 deletion bom/application/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
<microprofile-jwt.version>1.2</microprofile-jwt.version>
<smallrye-common.version>1.6.0</smallrye-common.version>
<smallrye-config.version>2.3.0</smallrye-config.version>
<smallrye-health.version>3.0.2</smallrye-health.version>
<smallrye-health.version>3.1.1</smallrye-health.version>
<smallrye-metrics.version>3.0.1</smallrye-metrics.version>
<smallrye-open-api.version>2.1.6</smallrye-open-api.version>
<smallrye-graphql.version>1.2.5</smallrye-graphql.version>
Expand Down
2 changes: 1 addition & 1 deletion build-parent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
<gradle-wrapper.version>6.9</gradle-wrapper.version>

<!-- MicroProfile TCK versions -->
<microprofile-health-api.version>3.0</microprofile-health-api.version>
<microprofile-health-api.version>3.1</microprofile-health-api.version>
<microprofile-config-api.version>2.0</microprofile-config-api.version>
<microprofile-metrics-api.version>3.0</microprofile-metrics-api.version>
<microprofile-fault-tolerance-api.version>3.0</microprofile-fault-tolerance-api.version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,13 @@ public class SmallRyeHealthConfig {
@ConfigItem(defaultValue = "well")
String wellnessPath;

/**
* The relative path of the startup health-checking endpoint.
* By default, this value will be resolved as a path relative to `${quarkus.smallrye-health.rootPath}`.
*/
@ConfigItem(defaultValue = "started")
String startupPath;

/**
* Whether the context should be propagated to each health check invocation.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
import io.quarkus.smallrye.health.runtime.SmallRyeIndividualHealthGroupHandler;
import io.quarkus.smallrye.health.runtime.SmallRyeLivenessHandler;
import io.quarkus.smallrye.health.runtime.SmallRyeReadinessHandler;
import io.quarkus.smallrye.health.runtime.SmallRyeStartupHandler;
import io.quarkus.smallrye.health.runtime.SmallRyeWellnessHandler;
import io.quarkus.smallrye.openapi.deployment.spi.AddToOpenAPIDefinitionBuildItem;
import io.quarkus.vertx.http.deployment.NonApplicationRootPathBuildItem;
Expand Down Expand Up @@ -260,6 +261,14 @@ public void defineHealthRoutes(BuildProducer<RouteBuildItem> routes,
.blockingRoute()
.build());

// Register the startup handler
routes.produce(nonApplicationRootPathBuildItem.routeBuilder()
.nestedRoute(healthConfig.rootPath, healthConfig.startupPath)
.handler(new SmallRyeStartupHandler())
.displayOnNotFoundPage()
.blockingRoute()
.build());

}

@BuildStep
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package io.quarkus.smallrye.health.runtime;

import io.smallrye.health.SmallRyeHealth;
import io.smallrye.health.SmallRyeHealthReporter;
import io.vertx.ext.web.RoutingContext;

public class SmallRyeStartupHandler extends SmallRyeHealthHandlerBase {

@Override
protected SmallRyeHealth getHealth(SmallRyeHealthReporter reporter, RoutingContext routingContext) {
return reporter.getStartup();
}
}
8 changes: 8 additions & 0 deletions integration-tests/reactive-messaging-kafka/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,14 @@
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-smallrye-reactive-messaging-kafka</artifactId>
<exclusions>
<!-- TODO remove once reactive-messaging upgrades to MP Health 3.1 -->
<!-- avoid convergence error; use health-api version from quarkus-smallrye-health -->
<exclusion>
<groupId>org.eclipse.microprofile.health</groupId>
<artifactId>microprofile-health-api</artifactId>
</exclusion>
</exclusions>
</dependency>


Expand Down

0 comments on commit d767e4c

Please sign in to comment.