Skip to content

Added /livez and /readyz endpoints using Spring Boot Actuator health …#2320

Closed
GaneshReddy239 wants to merge 0 commit intospring-projects:mainfrom
GaneshReddy239:main
Closed

Added /livez and /readyz endpoints using Spring Boot Actuator health …#2320
GaneshReddy239 wants to merge 0 commit intospring-projects:mainfrom
GaneshReddy239:main

Conversation

@GaneshReddy239
Copy link
Copy Markdown

This PR adds /livez and /readyz endpoints leveraging Spring Boot Actuator health probes.

  • Delegate health checks to Actuator
  • Expose only status (UP/DOWN) to avoid leaking internal details
  • Enable health probes for liveness and readiness support

This aligns the application with production practices and supports container orchestration systems like Kubernetes.

@@ -0,0 +1,28 @@
package org.springframework.samples.petclinic.owner;
import org.springframework.boot.health.actuate.endpoint.HealthEndpoint;
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.

please format the code

import org.springframework.boot.health.contributor.Status;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.Map;
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.

empty line should be here

import org.springframework.web.bind.annotation.RestController;
import java.util.Map;
@RestController
public class HealthEndpointController {
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.

Suggested change
public class HealthEndpointController {
class HealthEndpointController {

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