Skip to content

docs(web): add a health check to the Spring Boot getting started guide - #796

Merged
zdrawku merged 8 commits into
masterfrom
mgonzalez/4667-engine-termination-recovery
Nov 18, 2026
Merged

zdrawku merged 8 commits into
masterfrom
mgonzalez/4667-engine-termination-recovery

Conversation

@nerzhei

@nerzhei nerzhei commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Documents the Java SDK server status API from Infragistics-BusinessTools/Reveal#4762 in the Spring Boot getting started guide: when the Reveal engine process stops, the server answers 503 and doesn't recover, so the application reports it in its health check and the platform restarts it.

 ## Step 5 - Run the Server
 :::info Get the Code
+## Add a Health Check
+  1 - Add spring-boot-starter-actuator to pom.xml
+  2 - Declare IRevealServer as a bean, shared by the servlet and the health check; log its termination with getTermination()
+  3 - Add RevealServerHealthIndicator (DOWN unless getStatus() is RUNNING)
+  /actuator/health answers 503 once the server fails
+  Optional: add revealServer to the liveness probe group

The Japanese page (i18n/ja/.../getting-started-spring-boot.md) is not updated.

Evidence

  • Before: the guide has no way to detect a stopped engine.
    After: the Docusaurus dev server compiles the page without errors. The code follows the spring-boot-tomcat-standalone dev sample in the Reveal PR.

Merge Danger

Door: two-way

Docs only. Merge after Infragistics-BusinessTools/Reveal#4762 ships, since getStatus() and getTermination() don't exist in released SDKs yet.

Blast Radius: one page

🤖 Generated with Claude Code

nerzhei and others added 2 commits November 12, 2026 00:49
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@nerzhei
nerzhei marked this pull request as ready for review November 16, 2026 13:50

@zdrawku zdrawku left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO as a Spring Boot health-check guide it's solid, but it misses a few things your comment asked for, and one gap is about how users set the server up.

  1. Most users can't call the new API as documented today. install-server-sdk.md (both Spring Boot and Tomcat) and the other getting-started docs pass RevealEngineServlet a lambda that builds the server, so the application never keeps a reference to it. Those snippets should keep the built server in a variable or bean and pass that in instead. Otherwise getStatus() is unreachable. This change only covers this on the Spring Boot getting-started page.
  2. Do you thing we should add Tomcat / plain servlet example? We can add a short one that keeps the server in the ServletContextListener and exposes a /health servlet returning 503 unless the state is RUNNING.
  3. The "engine isn't restarted" point needs to stand on its own. It's currently buried in a getting-started step. Put it in a reference section, for example in install-server-sdk.md or a new "Java server status" page, and link to it from the Spring Boot guide.
  4. Callback caveats. Callbacks added with thenAccept run on the engine-exit thread or inside shutdown(), so recommend thenAcceptAsync(..., executor) plus .exceptionally(...). Note that FAILED stays FAILED even if the app shuts down afterwards.
  5. The readiness probe is left out. The dev sample adds revealServer to both the liveness and readiness groups; the docs only add it to liveness.
  6. Japanese page/changes when the main content is agreed on.

Lets also update the Export docs (exporting-dashboards.md / server-export.md, Java tab)

  • Exports now fail with ExportException("Export failed with status <N>: …") on 400 or higher, and with 503 once the engine has stopped.
  • Known limit: an export already running when the engine dies can still finish as a success with no file. Until that's fixed, callers should check that the file exists.

AND lets update the **release-notes.md as this change will be release with a preview.n version untill we have the official RTM, add a Section "## Preview" above the current h2 "2.3.2 (November 12, 2026)"

  • New Features: getStatus() and getTermination(), with a link to the health-check docs.
  • Breaking Changes → Java:
    • Exports used to return the error body where the file path should be; they now throw.
    • Classes implementing IRevealServer, such as mocks or decorators, no longer compile unless the follow-up adds default implementations.
  • Bugs → Java: the server used to report healthy and keep serving 503s after the engine died; it now reports the failure. Add the known limit on in-flight exports.

All of this can only go to Production when we release a preview with it. I would say 2.4.0-preview.0 that we can tag today

nerzhei and others added 4 commits November 16, 2026 16:44
…eview release notes

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Move the health check out of the Spring Boot getting started guide into a Java Health Checks page that covers Spring Boot and other servlet containers, and link it from the install page. Map Reveal on /reveal-api/* in the Spring Boot example, since a servlet on /* also receives /actuator/health.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ck page

Remove the Kubernetes mention and the Spring Boot probe groups, so the page only covers reporting the Reveal server status in the application's health check, and rename "Without Spring Boot" to "Servlet Containers".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@nerzhei

nerzhei commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor Author

IMO as a Spring Boot health-check guide it's solid, but it misses a few things your comment asked for, and one gap is about how users set the server up.

  1. Most users can't call the new API as documented today. install-server-sdk.md (both Spring Boot and Tomcat) and the other getting-started docs pass RevealEngineServlet a lambda that builds the server, so the application never keeps a reference to it. Those snippets should keep the built server in a variable or bean and pass that in instead. Otherwise getStatus() is unreachable. This change only covers this on the Spring Boot getting-started page.
  2. Do you thing we should add Tomcat / plain servlet example? We can add a short one that keeps the server in the ServletContextListener and exposes a /health servlet returning 503 unless the state is RUNNING.
  3. The "engine isn't restarted" point needs to stand on its own. It's currently buried in a getting-started step. Put it in a reference section, for example in install-server-sdk.md or a new "Java server status" page, and link to it from the Spring Boot guide.
  4. Callback caveats. Callbacks added with thenAccept run on the engine-exit thread or inside shutdown(), so recommend thenAcceptAsync(..., executor) plus .exceptionally(...). Note that FAILED stays FAILED even if the app shuts down afterwards.
  5. The readiness probe is left out. The dev sample adds revealServer to both the liveness and readiness groups; the docs only add it to liveness.
  6. Japanese page/changes when the main content is agreed on.

Lets also update the Export docs (exporting-dashboards.md / server-export.md, Java tab)

  • Exports now fail with ExportException("Export failed with status <N>: …") on 400 or higher, and with 503 once the engine has stopped.
  • Known limit: an export already running when the engine dies can still finish as a success with no file. Until that's fixed, callers should check that the file exists.

AND lets update the **release-notes.md as this change will be release with a preview.n version untill we have the official RTM, add a Section "## Preview" above the current h2 "2.3.2 (November 12, 2026)"

  • New Features: getStatus() and getTermination(), with a link to the health-check docs.

  • Breaking Changes → Java:

    • Exports used to return the error body where the file path should be; they now throw.
    • Classes implementing IRevealServer, such as mocks or decorators, no longer compile unless the follow-up adds default implementations.
  • Bugs → Java: the server used to report healthy and keep serving 503s after the engine died; it now reports the failure. Add the known limit on in-flight exports.

All of this can only go to Production when we release a preview with it. I would say 2.4.0-preview.0 that we can tag today

Thanks! Point by point:

  1. I kept install-server-sdk.md a minimal walkthrough. It now links to a new Java Health Checks page (java-health-check.md), which shows keeping the server in a bean or ServletContextListener and passing it to RevealEngineServlet.
  2. Added: the page has a Servlet Containers section with the listener and a /health servlet. Verified on Tomcat 10.1 and WildFly 42: 200 RUNNING, then 503 FAILED after killing the engine.
  3. Moved to its own page, linked from the install page, the Spring Boot guide, the export docs and the release notes.
  4. Added: use thenAcceptAsync with your own executor, handle the exceptions, and FAILED stays FAILED after shutdown.
  5. I dropped the probe groups instead, to keep the page platform-neutral: /actuator/health already answers 503 once the server fails.
  6. Added.

Export docs: the Java tab of server-export.md now says a failed export throws ExportException with the status, and 503 once the server has failed. I left out the in-flight limit: the code fails an export that's running when the engine dies with an ExportException; it doesn't succeed without a file.

Release notes: added ## Preview with the new API, exports now throwing, and the stale healthy status. I skipped the IRevealServer entry, since it isn't an extension point.

@nerzhei
nerzhei requested a review from zdrawku November 17, 2026 04:08
Add the Japanese Java Health Checks page and sidebar label, and translate the health check links, the failed export paragraph and the Preview release notes. Without the Japanese page, the ja build used the English one, whose link to the Spring Boot guide couldn't be resolved there.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@zdrawku zdrawku left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. On ### Breaking Changes: "Correction to my earlier ask: let's move the exports entry under Bugs → Java instead of removing it. Callers that checked the returned path still need to change their code, so keep the sentence and link it to the snippet in server-export.md. There's no IRevealServer entry to add: only the SDK implements it."

  2. On server-export.md
    "Suggest a short snippet. The exception arrives through the future, and the stream overloads (exportToPdf(dashboardId)) throw it too:"

    exporter.exportToPdf(dashboardId, filePath)
        .thenAccept(path -> send(path))
        .exceptionally(t -> { log.error("Export failed", t.getCause()); return null; });
  3. "Can you confirm what an export that's running when the engine dies does now? Earlier notes said it completes without a file, and your reply says it throws."

  4. java-health-check.md
    On the /reveal-api/* paragraph: "Moving Reveal off /* changes the client's setBaseUrl in every deployed app. Suggest management.server.port=8081 instead, so Actuator gets its own port and the mapping stays. Can you check it on the sample, the way you did Tomcat and WildFly?"

  5. On the revealServer bean: "Suggest keeping the existing servlet and reading revealServlet.getServlet().getRevealServer() in the indicator, plus setLoadOnStartup(1). That way the server's lifecycle doesn't change, and the servlet-container listener doesn't have to shut the server down itself."

  6. Under step 3: "On Kubernetes, /actuator/health/liveness only includes livenessState by default, so a failed engine never triggers a restart. Suggest adding management.endpoint.health.group.liveness.include=livenessState,revealServer back."

  7. At the end: "Suggest one paragraph for apps with no orchestrator, such as Tomcat on a VM or running as a Windows service: nothing restarts the app, so alert on the health endpoint."

dont forget the JP changes as well

Keep Reveal on /* and run Actuator on its own port, read the server from RevealEngineServlet in the health checks, and let the servlet build and shut down the server. Move the export entry to Bugs, add an export error handling snippet, and suggest an alert when nothing restarts the application. Update the Japanese pages to match.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@nerzhei

nerzhei commented Nov 18, 2026

Copy link
Copy Markdown
Contributor Author
  1. On ### Breaking Changes: "Correction to my earlier ask: let's move the exports entry under Bugs → Java instead of removing it. Callers that checked the returned path still need to change their code, so keep the sentence and link it to the snippet in server-export.md. There's no IRevealServer entry to add: only the SDK implements it."
  2. On server-export.md
    "Suggest a short snippet. The exception arrives through the future, and the stream overloads (exportToPdf(dashboardId)) throw it too:"
    exporter.exportToPdf(dashboardId, filePath)
        .thenAccept(path -> send(path))
        .exceptionally(t -> { log.error("Export failed", t.getCause()); return null; });
  3. "Can you confirm what an export that's running when the engine dies does now? Earlier notes said it completes without a file, and your reply says it throws."
  4. java-health-check.md
    On the /reveal-api/* paragraph: "Moving Reveal off /* changes the client's setBaseUrl in every deployed app. Suggest management.server.port=8081 instead, so Actuator gets its own port and the mapping stays. Can you check it on the sample, the way you did Tomcat and WildFly?"
  5. On the revealServer bean: "Suggest keeping the existing servlet and reading revealServlet.getServlet().getRevealServer() in the indicator, plus setLoadOnStartup(1). That way the server's lifecycle doesn't change, and the servlet-container listener doesn't have to shut the server down itself."
  6. Under step 3: "On Kubernetes, /actuator/health/liveness only includes livenessState by default, so a failed engine never triggers a restart. Suggest adding management.endpoint.health.group.liveness.include=livenessState,revealServer back."
  7. At the end: "Suggest one paragraph for apps with no orchestrator, such as Tomcat on a VM or running as a Windows service: nothing restarts the app, so alert on the health endpoint."

dont forget the JP changes as well

  1. Moved the exports entry to Bugs → Java and linked it to the export example.
  2. Added the snippet. The stream overloads fail through the returned future as well; they don't throw directly.
  3. It fails. If the engine dies during an export, the request to it fails and the export ends with ExportException("Export failed", ...); an error status ends with ExportException("Export failed with status N"). After that, every request gets 503 before it reaches the engine.
  4. Done. Actuator runs on its own port and Reveal stays on /. Tested on the Spring Boot sample: 200 UP, then 503 DOWN after killing the engine. management.server.port only works with the embedded server, so the page keeps /reveal-api/ as the option for a WAR in an external container.
  5. Done in both sections: the servlet builds the server with setLoadOnStartup(1), and the health check reads getRevealServer(). No more shutdown in the listener. Tested on Tomcat 10.1: 200, then 503 after killing the engine, and a normal stop shuts the engine down.
  6. I'd rather not add this one. We want the page to stay platform-neutral, without Kubernetes-specific settings. The page points the health check at /actuator/health, which includes every indicator, so a failed engine already answers 503 there and the restart happens.
  7. Added one sentence to the intro: if nothing restarts the app automatically, set up an alert on the health check.

The Japanese pages are updated with all of the above.

@zdrawku zdrawku left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd rather not add this one. We want the page to stay platform-neutral, without Kubernetes-specific settings. The page points the health check at /actuator/health, which includes every indicator, so a failed engine already answers 503 there and the restart happens.

I agree.

Thanks @nerzhei, well done!

@zdrawku
zdrawku merged commit 4d58dfd into master Nov 18, 2026
5 checks passed
@zdrawku
zdrawku deleted the mgonzalez/4667-engine-termination-recovery branch November 18, 2026 06:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants