Knock implements the standard MicroProfile Health 4.0 contract. Application code written against the spec — HealthCheck, HealthCheckResponse, @Liveness/@Readiness/@Startup — ports without change. Migration effort is concentrated in build configuration and in dropping vendor-specific extensions.
From SmallRye Health
| SmallRye | Knock | Note |
|---|---|---|
|
|
Identical. Keep your classes as-is. |
|
Same annotations |
Standard MicroProfile Health. No change. |
Vendor JSON extensions / extra fields |
Standard JSON only |
Knock emits the spec payload exactly ( |
Reactive / Mutiny checks |
Synchronous |
Knock runs each |
|
Not applicable |
Knock has no vendor configuration surface; behaviour follows the spec. |
Migration steps
-
Replace the SmallRye Health dependency with
knock-api,knock-core,knock-cdi-vaubanandknock-jaxrs(see Reference). -
Ensure each
HealthCheckcarries exactly one probe qualifier — Knock rejects unqualified checks at deployment time. -
Remove any vendor-specific extra data fields if downstream consumers required the strict spec payload.
-
Add a
module-info.javarequiringmicroprofile.health.api(Knock is strict JPMS). -
Verify the four endpoints respond and the aggregate HTTP status is
200/503as expected.
Pitfalls
-
Unqualified checks — a
HealthCheckwithout@Liveness/@Readiness/@Startupfails CDI validation. Add the missing qualifier. -
Non-standard JSON — consumers relying on vendor fields must be updated; Knock emits only the spec shape.
-
datatyping — onlyString,long,booleanandintare rendered natively; other types are stringified. -
Module path — missing
requiresclauses surface as JPMS resolution errors rather than classpath warnings.
Going further
-
Getting started — add Knock to a project.
-
Concepts — the health model.
-
TCK status — conformance guarantees.